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

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!
    – JustMe
    Oct 21, 2020 at 4:52

Your Answer

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

Not the answer you're looking for? Browse other questions tagged or ask your own question.