<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.

/* Usage Example */
.box {
  /* Rounds 15.7px to the nearest multiple of 10px (which is 20px) */
  width: round(15.7px, 10px);
}
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.

125+
118+
15.4+
125+
Kinsta

Your first month is free

Managed WordPress hosting for faster sites.

Learn more

New CSS drops.

Join 600+ readers who've survived clearfix hacks.

ESC