Can we use this <body class = "all" <! - [if IE 7]> class = "ie" <! [Endif] - >>
4 answers
You can use:
<body class="all">
<!--[if ie]>
<div class="ieOnly">
<![endif]-->
<div id="content">
<p>...</p>
</div>
<!--[if ie]>
</div>
<![endif]-->
</body>
Thus, the css selector for troubleshooting IE flaws / differences is more specific than regular
#content {/* for non-IE browsers */}
body.all .ieOnly #content {/* for IE */}
... and should override the 'normal' rules #contentand will never be applied by browsers other than IE, since the selector has an element .ieOnlythat is otherwise "invisible" to them.
, , ; , , .
+2