/ 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.
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.
Expand |
Embed | Plain Text
Copy this code and paste it in your HTML
<SharePoint:CssRegistration name="<% $SPUrl:~sitecollection/Style Library/css_hub.css %>" After="corev4.css" runat="server"/>