calc

Used to specify the calculated value of properties that use size, angle, time, number as values. This allows you to set values based on adding or subtracting different units of measurement, for example you can set 100% - 20px. If the value cannot be calculated, it is ignored.

Syntax



calc() = calc( calc-sum )
calc-sum = calc-product [ [ '+' | '-' ] calc-product ] *
calc-product = calc-value [ '*' calc-value | '/' calc-number-value ] *
calc-value = number | dimension | percentage | ( calc-sum )
calc-number-sum = calc-number-product [ [ '+' | '-' ] calc-number-product ] *
calc-number-product = calc-number-value [ '*' calc-number-value | '/' calc-number-value ] *
calc-number-value = number | ( calc-number-sum )