locked
How to include style sheet class directly in SharePoint layout page RRS feed

  • Question

  • I have developed the SharePoint layout page, I want to include below style sheet class directly in layout page. But it is not allowing including Style Sheet direct in layout page, which works fine for master page.

    Business Requirement: Want to remove the “quicklaunchheader” and “recyclebin” from left “Quick Launch Menu” of Layout page.  I don’t want to remove this content from master page.  So I want to include below Style Sheet only for layout page.

    <style type="text/css" >
       .ms-quicklaunchheader {
       display: none;
        }

        div.ms-quicklaunch table.ms-recyclebin {
        display: none;
        }
    </style>

    Please share your thoughts


    Amit
    Tuesday, February 9, 2010 3:54 PM

Answers

All replies

  • You can place CSS in a Page Layout. For instance this is in DefaultLayout.aspx:

    <asp:Content ContentPlaceHolderId="PlaceHolderAdditionalPageHead" runat="server">
    <style>
    TD.ms-titleareaframe, .ms-pagetitleareaframe {
    	height: 10px;
    }
    Div.ms-titleareaframe {
    	height: 100%;
    }
    .ms-pagetitleareaframe table {
    	background: none;
    	height: 10px;
    }
    </style>
    </asp:Content>
    
    <asp:Content ContentPlaceHolderId="PlaceHolderBodyAreaClass" runat="server">
    <style type="text/css">
    .ms-bodyareaframe {
    	padding: 0px;
    }
    </style>
    </asp:Content>
    

    What error are you getting?
    • Proposed as answer by Devignly Tuesday, February 9, 2010 8:26 PM
    • Marked as answer by Lu Zou-MSFT Thursday, February 11, 2010 5:15 AM
    Tuesday, February 9, 2010 4:12 PM
  • Thanks for suggestion, It is working perfect if I use <asp:Content ContentPlaceHolderID="PlaceHolderAdditionalPageHead" runat="server" > to include the style sheet on layout page.

    As placeholder "PlaceHolderAdditionalPageHead" makes it possible to add items such as extra meta tags into the HEAD section of page.


    Amit
    Tuesday, February 9, 2010 5:22 PM
  • Yes, this article explain and have a feature to manage your meta tags without using sharepoint designer. 
    http://www.mtelligent.com/journal/2008/1/11/using-the-delegate-control-to-add-meta-tags-to-sharepoint-pa.html
    André Lage Microsoft SharePoint, CRM and Sybase Consultant
    Blog:http://aaclage.blogspot.com
    Codeplex:http://spupload.codeplex.com/http://simplecamlsearch.codeplex.com/
    • Marked as answer by Lu Zou-MSFT Thursday, February 11, 2010 5:15 AM
    Tuesday, February 9, 2010 5:41 PM