On 29/07/2011 12:27 PM, Philippe Wittenbergh wrote:

On Jul 29, 2011, at 9:45 AM, David Laakso wrote:

There should be a space between the star and html:

* html .whatever {...}

Indeed.

This will not make it valid.

Nope. * html {} is perfectly valid (CSS1, 2, 3, 4, and beyond).

In a decent browser, it won't select anything and nothing though...
That hack relies on the fact that the simple little mind of IE 6&  7
‘thinks’ there is an element that wraps around the root element
(html). Of course there is none.

Philippe -- Philippe Wittenbergh http://l-c-n.com/


This is not correct. For IE6 and earlier, there is an element outside <html>. I received this message offlist (not stating the list) in 2008.

  | I mean the fact that

  | * html {...}

  | Ever applied to anything was a bug.  I wrote the
  | original selector-matching code that had this bug
  | in it.  We had a special hidden "root container"
  | node in our element tree for some internal reasons,
  | and I forgot to explicitly skip it in the selector
  | node matching code.  We didn't discover this for
  | years.  :)


This means that IE6- sees this.

<root-container>
  <html> ... </html>
</root-container>


This bug was partly corrected in IE7 but the universal selector '*' was now selecting the <!doctype> as if it was an element. This is why a sibling selecting was needed in the IE7 only hack.

*+html { /* IE7 style */ }

<!doctype> + <html>


For anyone following this thread, the below article gives some history of IE hacks (with links). The article is worded to suit the times of IE8 beta release.

http://css-class.com/test/bugs/ie/ie-hacks.htm



--
Alan Gresley
http://css-3d.org/
http://css-class.com/
______________________________________________________________________
css-discuss [[email protected]]
http://www.css-discuss.org/mailman/listinfo/css-d
List wiki/FAQ -- http://css-discuss.incutio.com/
List policies -- http://css-discuss.org/policies.html
Supported by evolt.org -- http://www.evolt.org/help_support_evolt/

Reply via email to