I've got a blank we-part page. What I would like to do is hide the side-bar and possibly some of the upper menus - to give us more real estate for a report that will be embedded on the page.

I've added a Content Editor webpart with the following code:

<style type="text/css">
     .ms-webpartPage-root {
         border-spacing: 0px !important;
       .ms-webpartzone-cell {
         margin: 0px !important;

     div#contentBox{margin:0 20px;}

When I press Apply the side-bar goes but then when I check the page in it reappears - then if I inspect the content editor the css has changed to the following:

.--root {
border-spacing:0px !important;

.--cell {
margin:0px !important;


margin:0 20px;

What is happening and how do I start going about hiding some of the menus ?

Any help appreciated, Jason

  • Do you face the same behavior with Script Editor Web Part? try to use it and feedback us with the result – Mohamed El-Qassas MVP Dec 9 '17 at 16:17

I tried to use your style in Script Editor Web part that gives me the desired result.

enter image description here


After adding your style to Script Editor Web part then I checked in the page, everything works fine as shown below:

enter image description here

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.