Return to Snippet

Revision: 30602
at April 20, 2011 11:22 by rumremix


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

Revision: 30601
at April 20, 2011 11:19 by rumremix


Updated Code
<!-- example 1 --> <SharePoint:CssRegistration After="corev4.css" runat="server"/>
<SharePoint:CSSRegistration After="<%>" runat="server"/>

<!-- example 2 --><SharePoint:CssRegistration name="<% $SPUrl:~sitecollection/Style Library/css_hub.css %>" After="corev4.css" runat="server"/>

Revision: 30600
at April 20, 2011 11:17 by rumremix


Updated Code
<!-- example 1 --> <SharePoint:CssRegistration>" After="corev4.css" runat="server"/>
<SharePoint:CSSRegistration>" After="<%>" runat="server"/>

<!-- example 2 --><SharePoint:CssRegistration name="<% $SPUrl:~sitecollection/Style Library/css_hub.css %>" After="corev4.css" runat="server"/>

Revision: 30599
at August 18, 2010 03:21 by rumremix


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

Initial URL


Initial Description
Using the CssRegistration control is the proper way to register CSS in a SharePoint master page/layout page, but it has drawbacks.  Namely, no matter what order you put them on the page the server loads them in a seemingly arbitrary order,  making it difficult to ensure that your CSS is loaded in the order you want.  If you want to force the order you can use the After attribute, but it will only work if you give it the full path.  



 Notice that corev4.css doesn’t need the full path.  I believe it is using the location of corev4.css as a it’s default, so it doesn’t need the whole path.

Initial Title
sharepoint master page css link

Initial Tags
css, link, sharepoint

Initial Language
C#