Sunday, May 20, 2012

Adding a custom CSS file to your SharePoint 2010 master page

I have been meaning to blog for quite some time, but have been thinking that it will take way too much time. But let me start simple by documenting the single most impactfull change one can do to the visual side of SharePoint, namely change the master page by adding your own CSS file.

To get it to load correctly and in the right order to the native CSS files used by SharePoint you have to do it like this.

<SharePoint:CssRegistration name="<% $SPUrl:~sitecollection/Style Library/myCustomStyles/myCustomSheet.css %>" After="corev4.css" runat="server"/>

Place the line right before the closing </HEAD> tag and you'll be off to a good start.