I have a div class named switch control which has a div class named thumb as child
<div class="switch-control">
<div class="thumb"></div>
</div>
and there are css for them called:
.switch-control > .thumb
.switch-control > .thumb::before
Both css classes are taking affect and used on chrome and firefox, but on IE8,9 the .switch-control > .thumb is active and the .switch-control > .thumb::before is marked out and not used thus I can’t see it taking affect on IE8,9
Why is that and how can I fix it ?
Thanks
IE9 has a tendency to cross out styles for pseudo-elements for some weird reason, but it does support the CSS3 double-colon notation for all supported pseudo-elements (this includes CSS1
::first-lineand::first-letter, and CSS2::beforeand::after). If your styles aren’t working, something else is wrong (there are a number of SO questions to this effect but I have no clue what could be causing the problem).IE8 does not support the CSS3 double-colon notation for any pseudo-elements, only the single-colon notation that has always traditionally been in use.
If you need to support IE8, you have to use the traditional single-colon notation (which every browser is expected to continue supporting for compatibility reasons):
And regarding your comment:
As I mentioned, pseudo-elements are now supposed to be prefixed with double colons, with single colons maintained for compatibility. It’s simply the new notation that should be used starting from CSS3 selectors and going forward, so when a browser’s developer tools encounter a pseudo-element rather than a pseudo-class, it displays it with double colons if it understands CSS3.
In other words, it’s just the browser UI showing it with double colons. It’s not altering the code in your stylesheet in any way.