CSS calc() Playground

Mr. Karim cuts the mat for Grandma Marni’s table: type a width with calc(), min(), max() or clamp(), the browser is the judge (what becomes of…

Why it matters

calc() is in almost every real layout: the width left after a sidebar, the screen height minus a header, a column minus a gap. And forget the spaces around -, and the browser drops the declaration without any error at all.

The key idea

calc() waits for layout to do the maths, and a - without spaces is not an operator

Common mistakes

Try it in this playground