SharePoint Blogs / SharePoint University
SharePoint Blogs and SharePoint University - all in one place!
Need SharePoint Training? Attend a SharePoint Bootcamp!

Please delete cookies related to sharepointblogs.com and sharepointu.com to resolve login issues!

How to apply css style sheet in Sharepoint

Apply css style sheet to Sharepoint master page has 2 ways:
1. In the header section, you can add any custom cascading styles sheets by using a simple link tag.
2. Use <SharePoint:CssRegistration> tag. This approach offers a few advantages because you have an option to use SPUrl, which returns the URL of the current site. css style sheet of this approach is stored in the Sharepoint content database instead of file system.

Example:
<head runat="server">
<asp:ContentPlaceHolder runat="server" id="head">
<title>
<asp:ContentPlaceHolder id="PlaceHolderPageTitle" runat="server" />
</title>
</asp:ContentPlaceHolder>
<Sharepoint:CssLink runat="server"/>
<!-- Product Group Custom Styles -->
<%--SharePoint:CssRegistration name="<% $SPUrl:~SiteCollection/Style Library/PG/PG.css%>" runat="server"/--%>
<link type="text/css" rel="stylesheet" href="/_layouts/1033/styles/PG/PG.css" />
<!-- End Product Group Custom Styles -->
<asp:ContentPlaceHolder id="PlaceHolderAdditionalPageHead" runat="server" />
</head>


http://msdn2.microsoft.com/en-us/library/bb727372.aspx


Posted 10-06-2007 12:07 AM by mingssn

Comments

Links (10/7/2007) « Steve Pietrek’s SharePoint Stuff wrote Links (10/7/2007) &laquo; Steve Pietrek&#8217;s SharePoint Stuff
on 10-07-2007 7:16 PM

Pingback from  Links (10/7/2007) &laquo; Steve Pietrek&#8217;s SharePoint Stuff

Add a Comment

(required)  
(optional)
(required)  
Remember Me?
Need SharePoint Training? Attend a SharePoint Bootcamp!
Posts (c) their respective authors. Everything else (c) 2009 SharePoint Experts, Inc.