CSS calc() फ़ंक्शन का उपयोग करके प्रॉपर्टी मानों की गणना करें, जैसे चौड़ाई, ऊंचाई, मार्जिन आदि। यह विभिन्न इकाइयों को मिलाने की अनुमति देता है।
उदाहरण
<!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>
व्याख्या: width: calc(100% - 100px) एलिमेंट की चौड़ाई को पैरेंट की पूरी चौड़ाई से 100px कम सेट करता है, जो रिस्पॉन्सिव डिज़ाइन में उपयोगी है।