<round>

A math function that rounds a value to the nearest multiple of another value. For example, you can use it to ensure a width always rounds to the nearest 10 pixels.

Quick example

.box {
  /* Rounds 15.7px to the nearest multiple of 10px (which is 20px) */
  width: round(15.7px, 10px);
}

<round> Browser Support

Newly available Since 2024 86% global usage

Since 2024 this feature works across the latest devices and browser versions. This feature might not work in older devices or browsers.

Works in all modern browsers. May need a fallback for older browsers.

125+
118+
15.4+
125+
ESC