A SharePoint page looks pretty cool but often we want to customize it according to our needs and standards. Some organizations do not allow the use of SharePoint Designer for reasons of security and integrity. Without access to SharePoint Designer, it looks tough to achieve.
This article will help you to hide SharePoint page elements without using javascript and using only simple css and a content editor webpart.
Below are the steps,
- Use developer tools to access the element on the page and note the value of its id or class name. If it uses multiple classes, try to take the Id or the first name of the classes it uses.
- Edit the page and add a content editor Webpart.
- Add the <style> and </style> tags.
- Now, we have to access the elements within the tags. If you are going to access it, using Id, then use “#” before the Id's name like #DeltaPlaceHolderSearchArea. If you are going to access the element, using class name, then use “.” Like .ms-breadcrumb-top.
- Afterwards, add the style property, which you want to modify with the value you want the element to have, separated by a “:” and within “{“ and “}”. In this case, we would like to set the value of the “display” property to “none”. Our final tag would be kind of like “<style>#DeltaPlaceHolderSearchArea { display : none; }</style>” OR “<style>.ms-breadcrumb-top { display : none; }</style>”.
- You can add the multiple elements within the same style tag.
- Once you are comfortable with the process, you can add your styles to another text file (without the style tags) and save it with extension “.css”. You can link this file to your page, using a content editor Webpart. The main advantage is that you do not have to take your page down to make the changes. All the changes made to the CSS file will reflect in your page by simply refreshing the page.
- Below are the Id's and classes of a few elements to get you started.
- Hide the Title Row
#s4-titlerow { display : none; }
- Hide the Search Box
#DeltaPlaceHolderSearchArea { display : none; }
- Hide the Bread Crumb
.ms-breadcrumb-top { display : none; }
- Hide the Top Bar
.ms-cui-topBar2 { display : none; }
- Hide the BROWSE and PAGE Tabs
.ms-cui-tts { display : none; }
- Hide the Browse Tab Only
#Ribbon.Read-title { display : none; }
- Hide the Page Tab Only
#Ribbon.WikiPageTab-title { display : none; }
- Hide the Buttons on the right of top bar
#RibbonContainer-TabRowRight { display : none; }
- Hide the Full Screen Button on the right of top bar
#fullscreenmodebox { display : none; }
- Hide the Site Icon
#siteIcon { display : none; }
- Hide the Bread Crumbs
.ms-breadcrumb-box { display : none; }
- Hide the Left Navigation Panel
#sideNavBox { display : none; }
Screenshots
- Page Elements
- Code
- Demo page