สามารถดึงค่าของคุณสมบัติใน CSS ได้โดยใช้ฟังก์ชัน calc() คุณสามารถลองรันโค้ดต่อไปนี้เพื่อนำฟังก์ชัน calc() ไปใช้ใน CSS ได้
ตัวอย่าง
<!DOCTYPE html> <html> <head> <style> #demo { position: absolute; width: calc(100% - 100px); background-color: blue; text-align: center; } </style> </head> <body> <h1>Heading One</h1> <div id = "demo">This is it!</div> </body> </html>