1) Only Internet Explorer appears to support the mod operator and it behaves as expected.
2) Make sure to include px
after the units for the modulo operation (as mentioned by C-link).
3) According to @Harry, the current specification has removed the mod operator from the calc function.
Check out the FIDDLE - (best viewed in Internet Explorer)
Sample markup -
<div class="container">
<div class="no">no calc</div>
<div class="simple">simple</div>
<div class="mod1">mod1</div>
<div class="mod2">mod2</div>
<div class="mod3">mod3</div>
<div class="mod4">mod4</div>
</div>
CSS (test cases)
.container {
width: 450px;
border: 1px solid black;
}
.no {
background:aqua;
}
.simple {
width:calc(100% - 100px);
background:green;
}
.mod1 {
width:calc(100% mod 200px); /* = 450 % 200 = 50px */
background:red;
}
.mod2 {
width:calc(100% mod 300px); /* = 450 % 300 = 150px */
background:brown;
}
.mod3 {
width:calc(100% mod 50px); /* = 450 % 50 = 0 */
background:orange;
}
.mod4 {
width:calc(50% mod 100px); /* = 225 % 100 = 25px */
background:yellow;
}