Forums

How do i get the whole page to center in the middle of the screen? (3 posts)

  1. wordpressmatt
    Member
    Posted 4 months ago #

    OK. I've looked and looked and searched and searched. I'm new and I know this is a simple fix but I can't find it...

    Does anyone know how to adjust the CSS so that the entire blog is centered in the user's screen?

    Here's my blog...
    www.maritimejobfinder.com

    and here is the css I'm using

    You'll note that, now, my blog stretches across the entire screen and I want to tighten it up...

    If anyone could help I would really appreciate it.

    Matt

  2. webfwrd
    Member
    Posted 4 months ago #

    Just put it in a wrapper. Following codes may help -

    CSS
    
    #wrapper {width:800px}
    body {margin:0 auto}
    
    HTML
    
    <body>
    <div id="wrapper>
    Rest of your code
    </div>
    </body>
  3. drewactual
    Member
    Posted 4 months ago #

    add to css:

    #wrapper {
    width:700px; /*or width you want can be %, em, px, whatever*/
    margin:auto;
    }

    the idea is to assign a width, and then use auto margin to center it. the right way to do it is to assign the width declaration to your body tag, and auto margin it there... but you can split it up elsewhere if you so like. I didn't dig too deep into your css because it is not constructed in a way that is easy to quickly follow.. but what I told you is the jest of centering stuff...and should serve you well.

Reply

You must log in to post.

About this Topic