Forums

How to center my whole site in the browser (6 posts)

  1. sebastianwp
    Member
    Posted 1 year ago #

    I am new to WordPress and I am trying to center the site. So please help. Here is a link to the site http://www.canvasarttalk.com

    Thank you

  2. @mercime
    Member
    Posted 1 year ago #

    Centering should be done in style.css of your theme. Add text-align: center; to body

    body {
    background:none repeat scroll 0 0 #FFFFFF;
    color:#000000;
    font-family:arial;
    font-size:11px;
    line-height:14px;
    text-align: center;
    }

    Then add text-align: left; to .main div

    .main {
    margin:auto;
    width:100%;
    text-align: left;
    }

    You might want to change width to say 960px more or less. Otherwise, there's nothing to center at all since .main div is 100% of body.

  3. sebastianwp
    Member
    Posted 1 year ago #

    Thanks I will try it.

  4. sebastianwp
    Member
    Posted 1 year ago #

    Hi mercime,
    Thank you but it isn't working. It makes all text align in center and moves my header to the right. Still need help please.

  5. Ross Hanney
    Member
    Posted 1 year ago #

    Hi Sebastianwp,

    Try adding the following to the end of your theme's CSS file:

    .main, .content, #footer{
      width:1200px;
      margin:auto;
    }

    Hopefully that should center everything.

  6. sebastianwp
    Member
    Posted 1 year ago #

    Hi,
    Thank you so very much. You saved me. It works perfectly.

Topic Closed

This topic has been closed to new replies.

About this Topic