What this document shows

This document is a CSS bug report and test document for Opera 9.0.2. It aims to show that Opera fails to apply background-properties to HTML:before and HTML:after. For this purpose, the document contains 4 pseudo elements: html:before, html:after, body:before and body:after. All pseudo-elements have exactly the same background-color, and some have a background-image. But in Opera 9.02 for Mac OS X, neither the background-color nor the background image shows for the pseudo-element html:before. While it does show for practically identically styled body:before element.

The only difference that matters between these two pseudo-elements, is the kind of «mother element» each pseudo-element has: HTML or BODY.

Both the HTML:before and BODY:before has the CSS rule position:fixed applied to them. And it turnes out that if you make the element un-positioned, then the background-color does show! As long as you do not use display:block - that is, since it turnes out the background also disappears with the CSS rule display:block.

So, for the html:after element, I have applied the style rule position:static and display:inline-block, and therefore the html:after element gets its background-color even in Opera.