CSS calc() Function (original) (raw)

Last Updated : 30 Aug, 2024

The calc() function is an inbuilt CSS function used to perform calculations to determine CSS property values dynamically. This function allows combining different units, such as percentages and pixels, using basic arithmetic operations like addition, subtraction, multiplication, and division. This article explores the syntax, usage, and benefits of the calc() function, demonstrating its practical applications through examples to help you enhance your web design flexibility and efficiency.

**Syntax:

calc( Expression )

**Parameters: This function accepts single parameter _Expression which is mandatory. This parameter contains mathematical expressions which need to implement. The operators used by this parameters are: +, -, *, /

**Example: The below program illustrates the calc() function in CSS:

html `

calc function