I followed the instructions in this other theard and I am having a problem with IE8. It works fine with Chrome and Firefox. I have cleaned the cache.

Here's what I have done: myTest.css

background-color: red;

Registration in master page:

  <SharePoint:CssRegistration name="<% $SPUrl:~SiteCollection/Style Library/css/myTest.css %>" After="corev15.css" runat="server"/>

Does javascript interfer here? Any idea how to resolve this?

Thank you.

2 Answers 2


try changing it to

background-color: red !important;
  • Thanks a lot Stephen! Thad did the trick. I had seen it in another example, but neglected to use it.
    – Imir Hoxha
    Commented Jan 24, 2014 at 13:14
  • Interesting - I tried this and it works on page load but then immediately switches back to the default?
    – thanby
    Commented Jan 24, 2014 at 13:18
  • could be another CSS file or JS somewhere on the page...?
    – Stephen
    Commented Jan 24, 2014 at 13:20
  • That's the only CSS file and there's no JS that should interfere with it, guess I'll just have to dig around a bit
    – thanby
    Commented Jan 24, 2014 at 13:22
  • I am having now the same issue as thanby. Actually what I saw was the page being loaded and once it finished the color reverted back to the original blue color.
    – Imir Hoxha
    Commented Jan 24, 2014 at 13:24

you need to use !important to force that css to the control.

In your case it looks like it overwritten! you could put the css registration within the masterpage to be the last one to register, dont forget it procedural!

also like to note that you should inspect the element using f12 deverloper tools, when you inspect as its changing the element you should see your css on the right but it would have a red strikethrough as its overwritten.... look for other css class that is overwriting it, it should be shown underneath it! it will also state which .css file its comming from and what its using.

You could have some JS file after the dom is loaded that is overwriting the css or a css class that is called later in the tree that also has important or more explicit call!

the only way to find out is by inspecting the element on developer tools!

Your Answer

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

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