Posted By

rumremix on 08/18/10


Tagged

css link sharepoint master-page


Versions (?)

Who likes this?

3 people have marked this snippet as a favorite

digiteyes
Tyster
jlaws0n


sharepoint master page css link


 / Published in: C#
 

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.

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

Report this snippet  

You need to login to post a comment.