Perform calculations to determine CSS property values

CSSWeb DevelopmentFront End Technology

Get the values of properties in CSS using the calc() property. You can try to run the following code to implement the calc() function in CSS

Example

Live Demo

<!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>
raja
Published on 31-May-2018 10:59:35
Advertisements