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

1
  • What do you mean by limit the page width for wiki page? Jul 17, 2019 at 12:36

1 Answer 1

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.

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

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

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