<mod>

A math function that returns the remainder of a division (modulo). This is useful for complex layouts where you need elements to repeat or cycle based on a value.

/* Usage Example */
.pattern-offset {
  /* Calculates an offset that wraps around every 20px */
  left: mod(var(--current-pos), 20px);
}
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