Experimental: This is an experimental technology
Check the Browser compatibility table carefully before using this in production.
The rem()
CSS function returns a remainder left over when the first parameter is divided by the second parameter, similar to the JavaScript remainder operator (%
). The remainder is the value left over when one operand, the dividend, is divided by a second operand, the divisor. It always takes the sign of the dividend.
For example, the CSS
rem(27, 5)
function returns the remainder of2
. When dividing 27 by 5, the result is 5 with a remainder of 2. The full calculation is27 / 5 = 5 * 5 + 2
.