Centering a page in the default theme

We're using the default (as opposed to the documentation) theme for all our spaces. We like the sidebar provided by the default theme and would prefer to keep it. However, one thing we really like better in the documentation theme is the way the pages appear to be limited in width and centered in the page window.

So with that in mind, here's my question: Is there a way in CSS (or other stylesheets) to limit the width and center the page, but otherwise keep the default theme (and do it on a space by space basis)? I was able to modify the space CSS to limit the width, but the page is left-justified, with a big gray bar running down the right side of the screen when on a bigger monitor.

Thanks,

Jason

1 answer

0 votes

Jason,

You should be able to accomplish this in CSS by adding auto margins to the left and right of the element being limited in width. Example:

.element_being_centered{
      margin-left: auto;
      margin-right: auto;
      width: 70%;
}

Cheers,

Stephen Brannen | Confluence Support

Thanks Stephen - but do you have any idea what the element would be? I haven't been able to figure it out on the default theme. For the documentation theme, it's "main"... But that doesn't work on the default theme.

Suggest an answer

Log in or Sign up to answer
Community showcase
Posted Oct 24, 2018 in Confluence

Atlassian Research opportunity with Confluence templates

Do you use templates with Confluence? Take part in a remote 1-hr workshop. You'll receive USD $100 for your time!   We're looking for people to participate in a   remote 1-hr workshop...

996 views 14 12
Join discussion

Atlassian User Groups

Connect with like-minded Atlassian users at free events near you!

Find a group

Connect with like-minded Atlassian users at free events near you!

Find my local user group

Unfortunately there are no AUG chapters near you at the moment.

Start an AUG

You're one step closer to meeting fellow Atlassian users at your local meet up. Learn more about AUGs

Groups near you