Tuesday, August 5, 2014

Add custom CSS file to a Sharepoint 2010 site

Open up your current masterpage. This is usually v4.master by default,  and always located in the “_catalogs/masterpage” directory. Remember to make a copy of it and edit the copy! Then set it as your default Master page.
Right before the
<asp:contentplaceholder id="PlaceHolderAdditionalPageHead" runat="server">
</asp:contentplaceholder>


tag, put the following line of code to include a reference to your custom CSS file.

<sharepoint:cssregistration after="corev4.css" name="&lt;% $SPUrl:~SiteCollection/Style Library/Custom/styles.css %&gt;" runat="server">
</sharepoint:cssregistration>


Done!

No comments:

Post a Comment