— by Eva


The CSS round() function is a mathematical function that rounds a given numeric value to the nearest integer. The round() function can be used within the calc() function or with CSS properties that accept lengths, such as width, height, and margin. By utilizing round(), we can ensure that dimensions are consistently displayed without decimal values, enhancing the visual alignment and overall aesthetics of web elements.

Session CodePen

See this Pen on CodePen.

Browser Support

Caniuse: round()