Stats

127 Contributors: 12 Wednesday, March 15, 2017
Licensed under: CC-BY-SA
Not affiliated with Stack Overflow
Rip Tutorial: riptutorial@gmail.com
Roadmap: roadmap

Functions

Syntax

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

Remarks

For calc(), white space is required around the "-" and "+" operators, but not the "*" or "/" operators.

All units must be of the same type; trying to multiply a height by a time duration, for example, is invalid.

Related Examples