Applications

The SharePoint CssLink and CssRegistration Server Controls

The SharePoint:CssLink and SharePoint:CssRegistration controls work together in order to inject the various CSS style sheet references on a page. The SharePoint:CssLink server control must reside on the master page while the SharePoint:CssRegistration server controls may be placed on a master page, page layout, or content page where appropriate. When the page is assembled, all of the CssRegistrations from the various components that are brought together to build the page are rendered by the SharePoint:CssLink server control.

When using CSS, the order in which the style sheets are placed on the page determine what styles will override others from the varying style sheets. The style sheet that is placed last – deemed more relevant – is the one associated with the current site theme.  Immediately above it is the CSS that is currently registered as the Alternate CSS URL for the site. Next, is a reference to the core.css. If it is a publishing site, the HtmlEditorTableFormats.css and the HtmlEditorCustomStyles.css are placed above the core and any additional style sheets registered with the SharePoint:CssRegistration control are placed at the top of the list.

Leave a Reply

x

We use cookies to ensure the best possible experience on our website. Detailed information on the use of cookies on this site is provided in our Privacy and Cookie Policy. Further instruction on how to disable our cookies can be found there.