Mathematical expression calc() is a function in CSS, mainly used for mathematical operations. Using calc() provides convenience and new ideas for page element layout.
Definition
The mathematical expression calc() is the abbreviation of calculate. It allows the use of four operators, -, *, /, and can be mixed with %, px, em, and rem. Calculate with other units
Compatibility: IE8-, safari5.1-, ios5.1-, android4.3- are not supported, android4.4-4.4.4 only supports addition and subtraction. IE9 does not support backround-position
(recommended tutorial:CSS tutorial)
Note: There must be whitespace characters on both sides of the and-operator
Examples are as follows:
测试文字一测试文字二
Application
Mathematical expression calc() is often used for numerical operations in different units in layout
left
right
right
Related video tutorials Recommended:css video tutorial
The above is the detailed content of Detailed introduction to mathematical expression calc() in css. For more information, please follow other related articles on the PHP Chinese website!