Home  >  Article  >  Operation and Maintenance  >  How to use calc() in CSS3

How to use calc() in CSS3

WBOY
WBOYforward
2023-05-16 21:25:04890browse

CSS3 calc() usage

calc() usage is similar to a function and can set dynamic values ​​​​for elements:

/* basic calc */
.simpleBlock {
 width: calc(100% - 100px);
}

/* calc in calc */
.complexBlock {
 width: calc(100% - 50% / 3);
 padding: 5px calc(3% - 2px);
 margin-left: calc(10% + 10px);
}

The above is the detailed content of How to use calc() in CSS3. For more information, please follow other related articles on the PHP Chinese website!

Statement:
This article is reproduced at:yisu.com. If there is any infringement, please contact admin@php.cn delete