Note: this does not work in WSS, only MOSS. You need the Microsoft.SharePoint.Publishing namespace for this tutorial to be of any use.
One of the biggest parts of creating a professionally customized Sharepoint 2010 site is being able to provide your own custom CSS. This allows you to alter the appearance of just about every element on the page, and provide your own branding in place of SP2010′s default styles. However, getting that custom CSS file hooked into your site can be a bit tricky.
Create Your CSS
The easiest and most straightforward method is to include a link to your custom CSS in your masterpage. Hopefully you can open your site in Sharepoint Designer 2010. If you can, open it up, then navigate to the “Style Library” folder and right click it to create a new folder called “Custom”. Inside this newly created folder, create a new file called “styles.css”. You will put all your custom CSS in here, and load it after the default Sharepoint styles to override/change what you need
Alter Your Masterpage
Next, open up your current masterpage. This is usually v4.master by default, and always located in the “_catalogs/masterpage” directory. Right before the
<asp:ContentPlaceHolder id="PlaceHolderAdditionalPageHead" runat="server">
tag, put the following line of code to include a reference to your custom CSS file you just created.
<SharePoint:CssRegistration name="<% $SPUrl:~SiteCollection/Style Library/Custom/styles.css %>" After="corev4.css" runat="server"/>
This snippet registers your custom CSS file, and loads it after the “corev4.css file, a default sharepoint stylesheet that contains most of the CSS that governs sharepoints appearance.