Reputation: 7647
I want to add a specific style sheet for IE9 which overrides the img.icon css class with different margin values. So i add the below in the head section. But when page loads it display as a text in browser.
<!--[if IE 9]>
img.icon {
float: right;
margin: 4px -31px;
}
<![endif]-->
Upvotes: 0
Views: 63
Reputation:
You are missing the <style>
tags
<!--[if IE 9]>
<style>
img.icon {
float: right;
margin: 4px -31px;
}
</style>
<![endif]-->
Upvotes: 2
Reputation: 2149
You forgot the style tags.
<!--[if IE 9]>
<style>
img.icon {
float: right;
margin: 4px -31px;
}
</style>
<![endif]-->
Also, you might find it easier to load an external stylesheet within the conditional comments:
<!--[if IE 9]>
<link rel="stylesheet" href="css/ie9.css">
<![endif]-->
Upvotes: 0
Reputation: 2424
<!--[if IE9]>
<style>
img.icon {
float: right;
margin: 4px -31px;
}
</style>
<![endif]-->
it think
Upvotes: 0