• Ho folks,

    I’m trying to center my main content (contentmiddle I believe) without much success. It’s always a bit off, even though I played with margins etc.

    Here my blog (still building, it’s a bit messy !) :

    Correr es mi destino

    Same thing, my two sidebars aren’t at the same top-margin…

    I’d appreciate advice ! I’m usually comfortable editing CSS (blogger experience) but this one is driving me crazy !

    I think you guys can see the CSS so I won’t clog this post with a page-long template CSS pasted ??

Viewing 4 replies - 1 through 4 (of 4 total)
  • If it is contentmiddle then the current code is as follows:

    #contentmiddle {
    float: left;
    width: 51%;
    margin: 0 10px 0 0;
    padding: 10px 10px 10px 10px;
    background: #B1D3EC;
    border: 4px solid #285577;
    }

    You’d want to deleter that float:left line.

    And change the left and right margins to auto (margin: 0 auto;).

    That should center it between the two sidebars.

    You can also make your stylesheet lighter by changing

    padding: 10px 10px 10px 10px;

    to

    padding: 10px;

    Thread Starter zhuli

    (@zhuli)

    Hi and thanks for replying,

    Removing the float: left; didn’t work well : it pushed my sidebar way down and “merged” the main content with the left sidebar.

    However, I played with the margins as you said and it’s a bit better…

    Maybe you can try to put this in your code:

    html, body
    {
    margin:0 auto;
    padding:0;
    }

    It’s worked to me, if you can’t resolve the problem let me know it!,

    Cheerz!,
    Hope this can Help!,

    I got it!!! I changed

    #content_box { width: 900px; text-align: left; float: left; clear: both; }

    TO

    #content_box { width: 900px; text-align: left; float: center; clear: both; }

    I still have the spaces though…………
    I will get rid of them… I will darn it, I will!

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘How to center my main content ?’ is closed to new replies.