God save position:relative

Licenced under CC-BY-4.0, created by Peter Molnar (), published at to canonical URL https://petermolnar.net/god-save-positionrelative/ with keywords #code #CSS #IE

How to fix Internet Explorer 8 rotation opacity bug

I’ve been searching for a very nasty bug that hits all versions of IE up to 8 in CSS.

Basically the bug is the following: there’s a div (#inner) placed inside an other (#container). If I give opacity to the inner element in IE8, the font color of the inner div (#inner) will become the same as the background-color of the outer (#container) element.

The solution was the same for the infamous anti-aliasing bug related to transparency: add position:relative to all elements, and thus: all bugs are fixed.

If you use

filter: progid:DXImageTransform.Microsoft.BasicImage(rotation=3);
-ms-filter: "progid:DXImageTransform.Microsoft.BasicImage(rotation=3)";

you need to add a background image to make IE render the font correctly.