calc()
calc() is a CSS function in the Functions category. Performs mathematical calculations with mixed units. The syntax is calc(<expression>). A typical example: width: calc(100% - 40px); It is commonly applied to markup such as <div class="demo">Sample</div> Browser support: Chrome 4+, Firefox 3.5+, Safari 3.1+, Edge 12+. A close relative is min(), which selects the smallest value from a list. A close relative is max(), which selects the largest value from a list. A close relative is clamp(), which clamps a value between a minimum and maximum. More about this category: CSS functions — calc(), var(), clamp(), min(), max() and more. Related Functions entries: min(), max(), clamp(), var(), env(), url(), attr(), rgb() / rgba(). This page is part of the free CSS Reference documentation covering 841+ properties, selectors, functions, and at-rules, each with syntax, values, examples, and browser support.