Here are some of the most common ways to reference your custom CSS for SharePoint 2010. One key change over 2007 is the ability to specify After=”corev4.css” in the CssRegistration to make sure your custom CSS is referenced after the OOTB corev4.css file.
<SharePoint:CssLink runat="server" Version="4"/> Note: Default OOTB
Output Order:
- <link rel="stylesheet" type="text/css" href="/_layouts/1033/styles/Themable/corev4.css"/>
Output Order:
- <link rel=”stylesheet” type=”text/css” href=”/_themes/[UniqueCounter#]/corev4-[u=UniqueHex#].css?ctag=[UniqueCounter#]”/>
Output Order:
- <link rel="stylesheet" type="text/css" href="/_layouts/1033/styles/customfolder/samplecustom.css"/>
- <link rel="stylesheet" type="text/css" href="/_layouts/1033/styles/Themable/corev4.css"/>
Output Order:
- <link rel="stylesheet" type="text/css" href="/_layouts/1033/styles/Themable/corev4.css"/>
- <link rel="stylesheet" type="text/css" href="/_layouts/1033/styles/customfolder/samplecustom.css"/>
Output Order:
- <link rel="stylesheet" type="text/css" href="/_layouts/1033/styles/Themable/corev4.css"/>
- <link rel="stylesheet" type="text/css" href="/Style%20Library/emc_2010_custom.css"/>
<SharePoint:CssRegistration name="<% $SPUrl:~sitecollection/Style Library/~language/Themable/Core Styles/samplecustom.css %>" After="corev4.css" runat="server"/>Note: Alternate CSS In SharePoint Database for sites with publishing enabled
Output Order:
- <link rel="stylesheet" type="text/css" href="/_layouts/1033/styles/Themable/corev4.css"/>
- <link rel="stylesheet" type="text/css" href="/[sitename]/Style%20Library/en-US/Themable/Core%20Styles/emc_2010_custom.css"/>
Output Order:
- <link rel="stylesheet" type="text/css" href="/_layouts/1033/styles/Themable/corev4.css"/>
- <link rel="stylesheet" type="text/css" href="/_layouts/1033/styles/customfolder/samplecustom.css" />