Center (5 posts)

  1. ctec67
    Posted 4 years ago #


    I set the site to have a fixed width, but can't find a way
    to center the entire site:

    I have a wide-screen monitor and it is all left aligned,
    how/where can I center the site?

    Thank You!


  2. CiderJack
    Posted 4 years ago #

    having the same problem. Can't find any answers on WP forums.

    The obvious solution (in my child theme css file) would seem to be:
    body {margin: 0 auto;}
    but this doesn't have any effect.

  3. playing2012
    Posted 4 years ago #

    The traditional way to center the entire page is to use CSS like this:

    body {
    	text-align: center;
    .wrap {
    	margin: 0 auto;
    	text-align: left;

    The idea of the above code is to center everything in the body of the page; Then you need to normalize the wrap so that everything is left-aligned.

    Please use a custom.css file to use this code which can be linked. If you know which file to use to link the custom.css then please let me know because I don't know this.

    Please post back with further info.

  4. CiderJack
    Posted 4 years ago #

    Thanks for the suggestion playing2012, but Bombax already includes text-align: center in the body tag. Also, Bombax uses body in the same way most themes use wrap -- in this case Bombax is customizable via the admin gui, and I've set the maximum width for the page to 1000px, and Bombax outputs the css:

    body {
       text-align: center;
       max width: 1000px;
       margin: 0 auto; /*added by me in the child theme<strong>EDIT:see below</strong>*/

    however the whole page still sits hard against the left side of the monitor.
    NEVERMIND I'm just an idiot

    looking closer at my actual code after I wrote the above, I discovered in my child theme I had written:
    #body {margin: 0 auto;} (as an id, rather than just the body tag)

    Thanks for the help playing2012, and now I feel bad for hijacking ctec67's thread!

    (tl;dr - resolved for me, however I can't speak for ctec67)

  5. IEMotoMag
    Posted 3 years ago #

    I'm having the same problem with Bombax, I am new to WordPress and CSS. Any help in newbie terms would be appreciated!

    Never mind, figured it out:

    body { margin: 0 auto; }

    in style.css

Topic Closed

This topic has been closed to new replies.

About this Theme

About this Topic