This project is read-only.

CSS with Page Layout

Apr 1, 2014 at 9:39 PM
Hello all,

I am currently trying to add my custom CSS to an individual page layout and not the master page. What seems like a simple task I can't seem to get done and would love any assistance anyone can give with this issue.

Thanks
Apr 1, 2014 at 9:49 PM
Under
<asp:Content  ContentPlaceHolderId="PlaceHolderMain" runat="server">
add your custom styling
<style type="text/css">
    .left-navbar {
        display:none!important;
    }
</style>
Apr 1, 2014 at 10:28 PM
Thanks for the quick reply what about if not a few lines of css but instead a reference to an actual style sheet for example how the master page references the CSS pages for customization.
Apr 1, 2014 at 11:35 PM
Edited Apr 2, 2014 at 1:37 PM
<link href="MyPageLayout.css" rel="stylesheet" type="text/css" ms-design-css-conversion="no" /> 
Something like this?

If you are editing the .html place the reverence under:
<!--MS:<asp:ContentPlaceHolder id="PlaceHolderAdditionalPageHead" runat="server">-->
Apr 10, 2014 at 1:56 AM
Yes, the ideal place in a page layout is to place in the content placeholder with an id of PlaceHolderAdditionalPageHead.

There is likely already a placeholder with this id in your page layouts, but if not the entire block would look like
<!--MS:<asp:ContentPlaceHolder id="PlaceHolderAdditionalPageHead" runat="server">-->
<link href="MyPageLayout.css" rel="stylesheet" type="text/css" ms-design-css-conversion="no" /> 
<!--ME:</asp:ContentPlaceHolder>-->
If you want to know what the property ms-design-css-conversion does, I wrote a blog post that included this property a while back.
http://ericoverfield.com/sharepoint-2013-tricks-web-fonts/

Eric