1

I'm having an issue with a css rule for IE that I need to write it properly in Sharepoint master page in order to be taken into consideration on page load in IE browser. The way I wrote the rule in the head of page, doesn't seem to be working for IE.

What I am doing wrong?

<head id="Head1" runat="server">
     <meta http-equiv="X-UA-Compatible" content="IE=10"/>
    <!--[if IE]>
        <style type="text/css">
            #image{
                position: relative;
            }
            .image-link {
                background: url("/someimages/somedirectory/sometransparentpixel.png") 0 0 repeat;
                margin-top: 10px;
            }
        </style>
    <![endif]-->
1
  • Take a look at here Commented Oct 20, 2020 at 2:14

1 Answer 1

0

If you are using the IE 10+ version, please use pure CSS like this:

@media screen and (-ms-high-contrast: active), (-ms-high-contrast: none)
{
   /* IE10 and IE11-specific styles go here */
}
@media screen and (min-width:0\0)
{
    /* IE9 and IE10 rule sets go here */
}

More information for your reference:

Adding CSS file for IE

1
  • Thank you very much! Indeed, condition doesn't work for IE 10+ so the CSS approach is perfect! Commented Oct 21, 2020 at 4:52

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.