CSS hack: Difference between revisions

Content deleted Content added
Random832 (talk | contribs)
"Box Model Hack": not actually clear IE7 has the parsing bug. removing
Random832 (talk | contribs)
Selector Hacks: Moved explanations from comments into prose.
Line 60:
==== Selector Hacks ====
===== Star HTML hack =====
The <code>html</code> element is the root element of the W3C standard [[Document Object Model|DOM]], but Internet explorer versions 5.5 and 6 include a mysterious parent element. Fully-compliant browsers will ignore the <code>* html</code> selector, while IE 5.5 and 6 will process it normally. This enables rules to be specified for these versions of Internet Explorer which will be ignored by all other browsers. For Example:example, this rule specifies text size in Internet Explorer 5.5 and 6, but not in any other browsers.
* html p {font-size: 5em; }
<pre>
* html p {font-size: 5em; /* Specifies text size in Internet Explorer 5.5 and 6, but not in any other browsers */ }
</pre>
 
===== html>body hack =====
Versions of Internet Explorer before version 7 do not support the "child selector" (<code>></code>), allowing rules to be specified for all browsers except Internet Explorer. For example:, this rule will turn paragraph text blue in Firefox, but not in IE.
<pre> html>&gt;body p {color: blue; /* Turns paragraph text blue in Firefox, but not in IE */}</pre>
 
==== Criticisms of Hacks ====