0

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]-->

3 Answers 3

2

You are missing the <style> tags

<!--[if IE 9]>
<style>
    img.icon {
        float: right;
        margin: 4px -31px;
    }
</style>
<![endif]-->
Sign up to request clarification or add additional context in comments.

Comments

0
 <!--[if IE9]>
<style>
    img.icon {
        float: right;
        margin: 4px -31px;
    }
</style>
    <![endif]-->

it think

Comments

0

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]-->

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.