The calc CSS function allows basic arithmetic to be performed on numerical values, using addition (+), subtraction (-), multiplication (*), division (/), and parentheses.
<calc()> = calc( <calc-sum> )
<calc-sum> = <calc-product> [ [ '+' | '-' ] <calc-product> ]*
<calc-product> = <calc-value> [ [ '*' | '/' ] <calc-value> ]*
<calc-value> = <number> | <dimension> | <percentage> | <calc-constant> | ( <calc-sum> )
An integer or zero or more decimal digits followed by a dot (.) followed by one or more decimal digits. The first character may be preceded by a sign (- or +). The last character may be succeeded by an exponent (e or E) and an integer.
A number with a unit.
Specifies the percentage using a number followed by a percent sign (%).
<calc-constant> = e | pi | infinity | -infinity | NaN
The base of the natural logarithm, approximately equal to 2.7182818284590452354.
The ratio of a circle's circumference to its diameter, approximately equal to 3.1415926535897932.
Not a number.