# calc(), min() and max(): Math in CSS

calc() does arithmetic with sizes, even mixing units such as 100% and 2rem, and min() and max() pick the smaller or the larger of two sizes, so a box fits a phone and a wide screen with no media query at all.

![Cheat sheet: calc(), min() and max(): Math in CSS](https://fsdtrainingmedia.blob.core.windows.net/public/images/2026/10/7686071b5c814276999125900123bb46.webp)

- Category: CSS
- Level: Journeyman
- Tags: calc(), ch unit, CSS, max(), min()
- Updated: November 1, 2026

Source: https://www.ask-codey.com/cheat-sheets/css-calc-min-max-cheat-sheet
