How to use the calc() function in CSS

1 Answer

0 votes
<!DOCTYPE html> 
<html> 
    <head> 
        <style> 
            .cls { 
                position: absolute; 
                left: 30px; 
                padding-top:20px; 
                width: calc(100% - 30%); 
                height:calc(400px - 240px); 
                background-color: lightblue; 
                text-align: center; 
            } 
            .fnt { 
                font-size:50px; 
                font-weight:bold; 
                color:white 
            } 
        </style> 
    </head> 
    <body> 
        <div class = "cls"> 
            <div class = "fnt">css calc() fcunction</div> 
        </div> 
    </body> 
</html> 

 



answered Apr 6, 2019 by avibootz
...