Usage of calc() CSS function

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 01-Jun-2018 10:59:14
Advertisements