IE 9 supports the notations ::after
and ::before
(with two colons) in “standards mode”. In “quirks mode”, it does not. This can be tested e.g. as follows:
<style>
p::after {
content: "***AFTER***";
}
</style>
<p>Hello world
Here the CSS rule is ignored, because IE 9 goes to quirks mode. But if you add the following line at the very start, IE 9 goes to standards mode and the CSS rule takes effect:
<!doctype html>
It is common in IE 9 that in quirks mode, new CSS features (most features that are neither in CSS 2.1 or in the IE legacy) are not supported. In quirks mode, IE 9 does not support the old one-colon notations :after
and :before
either. It supports them (but not the two-colon versions) in “IE 8 mode”, which you can select in developer tools (F12) manually, in the “document mode” menu, or at document level using the tag <meta http-equiv="X-UA-Compatible" content="IE=8">
.