Daily Archives: February 27, 2008

[SP Gotchas] Core.css Keeps Overriding My Styles!

If you use the CssRegistration and CssLink controls on a SharePoint page, core.css is always added to the HTML page last.  This means that any styles in core.css will override the styles you’ve defined in your custom stylesheets.  Does this make sense?! No.  But, like many other things in SharePoint, that’s the way it is.

A quick way to fix this is to just use a plain <link …> tag to include your stylesheets.  Since those aren’t processed server-side like links in the controls mentioned above, they will be loaded in the order you define in the HTML.

Heather Solomon has a blog post about this issue as well.