Opera 7–9.2 shows a rough “quantization” error when a margin
, padding
or border
has a value greater than 20.47
and it is expressed in em
units, or ex
, %
, cm
, in
(with other units, like px, the problem would not be visible, even if present.)
In the above conditions the decimals are simply ignored. For example, all margins of 21em
, 21.1em
, … up to 21.9em
are rendered exactly the same. This is not a simple rounding error.
Only margins, paddings and borders seem affected, not other properties (like width, left, top, …) The problem is not present below the threshold value of 20.47. No other browser displays a similar behaviour (not even Opera 6.)
The problem has been mostly fixed in Opera 9.5. Padding and margins expressed in em do not show it anymore. But other combinations still have problems, for example em borders still are wrong for values greater than 20.47. And when using percentage widths Opera still ignores all decimal figures (i.e.: width: x.y%
is always equal to width: x%
).
In the below test case there is a series of green bars having an increasing margin-left with a
0.1em
step. Check what happens (in Op7–9.2) when the value exceeds 20.47em: the margins do not increase regularly anymore, but in a “stepped” way.
Other em margin tests:
Some tests with other units: