Conditional CSS tags for IE showing in page
I've added the conditional CSS include tags for IE into the head of my document:
<!--[if lt IE8]>
<%= stylesheet_link_tag 'blueprint/ie' %>开发者_如何学Python;
<![endif]-->
Unfortunately this causes them to show up in the page when it's rendered in IE.
How can I banish them?
I think the right syntax is
<!--[if lt IE 8]>
<%= stylesheet_link_tag 'blueprint/ie' %>
<![endif]-->
Note the space between 'IE' and '8'. Not sure if this is your problem - but try it. Check this page for specifics of the conditionals.
The space should definitely be there. But that doesn't explain why it shows up.
Are you sure you didn't escape the brackets at the start of the comment? e.g. <!-- instead of <!-- ?
Conditional comments are very spacing sensitive. Follow the spacing in Microsoft's documentation slavishly. In this case, add a space after the <!--
and before the -->
.
精彩评论