07 September 2011

SharePoint: If your stylesheet isn't added to the page...

For a current project, I'm using a custom page layout within a publishing site. I had the following code in the my_page_layout.aspx file:
<asp:Content ContentPlaceholderID="PlaceHolderAdditionalPageHead" runat="server">
<link type="text/css" href="../../SiteAssets/js/jquery/jquery-ui-1.8.16/css/cupertino/jquery-ui-1.8.16.custom.css"/>
....
</asp:Content>
No matter what I did, the stylesheet wouldn't be available to the SharePoint page. However, another stylesheet was showing up. The difference? I was missing the rel="stylesheet" attribute on the bad link tag. Added it and everything worked.

No comments: