0

I don't have access to my master pages but I've used the Content Editor web part to hide the sidebar on one page and I'd like to limit the page width.

Is there a code I can use in a Content Editor to limit the page width for that page alone?

-Christian

  • What do you mean by limit the page width for wiki page? – Ganesh Sanap Jul 17 at 12:36
0

Assuming you want to limit the width of contents on the wiki page, you can add below CSS in your Content Editor web part(Which is added on the same page):

#contentBox {
    width: 800px !important;
    margin-left: auto !important;
    margin-right: auto !important;
}

Or

.ms-wikicontent {
    width: 800px !important;
    margin-left: auto !important;
    margin-right: auto !important;
}

You can specify the width according to your requirement instead of 800px.

  • Awesome! Now it presents my next problem -- how do I center the page? – naridox Jul 17 at 13:08
  • If you have hidden sideNavBox then it must be in center already? – Ganesh Sanap Jul 17 at 13:14
  • Not after limiting the page width. Now it left aligns. – naridox Jul 17 at 13:17
  • Try using updated code in answer – Ganesh Sanap Jul 17 at 13:22
  • HUZZAH!!! Thank you so much!! – naridox Jul 17 at 13:24

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.