Content deleted Content added
→Selector Hacks: Moved explanations from comments into prose. |
|||
Line 7:
Conditional comments can be used to hide certain styles from a specific browser, or even to supply a tailored style sheets for individual browser versions.
This is an example of "downlevel hidden" conditional comment
<pre>
<!--[if IE 7]>
<style type="text/css">
<link rel="stylesheet" type="text/css" href="ie7only.css">
</style>
<![endif]-->
</pre>
This is an example of "downlevel revealed" conditional comment
<pre>
<![if !IE]>
<
<![endif]>
</pre>
However, this is invalid HTML, so an alternate form has been recommended by others. [http://www.456bereastreet.com/archive/200511/valid_downlevelrevealed_conditional_comments/]
<pre>
<!--[if !IE]>-->
<link rel="stylesheet" type="text/css" href="non-ie.css">
<!--<![endif]-->
</pre>
Note that IE 4 does not support conditional comments at all.
=== "Hacks" ===
|