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.
- <SharePoint:CssRegistration name="<% $SPUrl:~sitecollection/Style Library/css_hub.css %>" After="corev4.css" runat="server"/>
You need to login to post a comment.