Saturday, June 22, 2013

SharePoint 2010 Custom Master page Design and Register custom CSS



In this article, I will help you to understand how to design master page and register custom CSS. SharePoint 2010 comes with OOB Master Pages; v4.master page is the default master in SharePoint 2010. Master pages are basically used to give consistent look throughout the site as well as it includes common elements throughout the site.
We will be using copy of v4.master page to design the custom master page. Firstly I will explain how to register custom CSS in master page; so open your site in SharePoint 2010 Designer
Click on the Master page from left menu and copy v4.master page and rename it

Next we need to overrides the default core4.css applied to the newly created master page (BrandingTeamsite.master); click the All files from left menu and open the Style library. Right click on the Style library and add new CSS file.
Open the BrandingTeamsite.master page and search the head tag. Add the below link in the master page
            <SharePoint:CSSRegistration name="/Style Library/Teamsite.css" After="corev4.css" runat="server"/>
Or
            <SharePoint:CSSRegistration name="<%$SPUrl:~SiteCollection/Style Library/Teamsite.css%>"  After="corev4.css" runat="server"/>

In the future article we will focus on how to apply css to master page.