IE’s universal selector is really universal
September 17th, 2006
- Category:
- CSS,
- Web Development
As it turned out, the universal selector is a little too universal in IE 7 (RC 1).
Some simple CSS like
body * {
display: block;
border: 1px solid;
padding: .25em .5em;
background: #808080;
}
with such HTML
<body>
<p>
...
</p>
<!-- An HTML coment -->
<p>
...
</p>
</body>
results in 3 Boxes in IE 7.
This opens the door for some new hacks and even an amazing technique to make the :before and :after pseudo-elements possible to some extend.
This technique would also make for a good clearing floats without presentational markup, as long as the clear property is applied (not tested).
Apart from that, this is not a minor issue. With such a parser bug the universal selector becomes useless or we the web developers are doomed to never use HTML comments again to be able to rely on this selector. I cannot believe that this “feature” will make it into the final release.
3 Comments
Comments feed
Comment by Luna, October 9th, 2006 at 11:04 am
Comment by tester, October 19th, 2006 at 2:13 pm
Comment by Maurizio, March 4th, 2007 at 5:35 pm