Support » Themes and Templates » Set body to fixed width?

  • I am new to WordPress and was wondering if someone could tell me how to center the body and make it a fixed width.

Viewing 15 replies - 1 through 15 (of 16 total)
  • body {
    margin-left: auto;
    margin-right: auto;
    width: 750px;
    Add other attributes as required (border etc)

    @culturec : Nice looking blog and it seems cool in FF. I am not sure how the layout will look in IE though. Also looking thru the index I am just wondering what is going to happen on the comments page when the menu gets longer.

    Ok, that worked perfectly for the body, THANKS. But now my menu is still on the far right edge (instead of right side of the fixed area.) I have tried so many things that I had to go back to the default menu code because I had it so jacked. Any Ideas?

    I’m guessing the problem is that the standard css uses “position: absolute” for the header and menu. For the menu, the position is in px from the right side, meaning the browser will stick the menu in that absolute position, regardless of the body tag. If you haven’t already, you’ll have to rework the layout of those pieces to not use absolute positioning.

    OK, I give up. I know this can be done ’cause i’ve seen it on numerous blogs, but after 2 days of trying to edit just the menu i’m exhausted.

    Do you have a link ?
    Maybe we can help you out 🙂

    grab the css 🙂
    It’s actually wp_new (from Alex Kings styles page) but with my poor graphic in the top and things a bit wider ….

    Thanks, I’ll try that. Nice page btw. Liked the “body art” links.

    Thanks !

    Tried checking the divs ?
    It may be called in the wrong place .. certainly my fiddling with the css does nothing.

    With float set up as you have it you would need to invert the index.php so that the menu in its entirety comes before the content. Alternatively you can use float: left for the content and float: right for the menu which is the recommended solution.

    Thanks, it was the fact that I had the menu set to float=right and after the content. I put the menu first (before I read Root’s post) and it worked, but the content and the margin seemed to have an imaginary margin which kept me from lining them up exactly. I then put it back as it was and did as Root said and added the float=left to the content and everything worked great.
    Thanks! Now that I have the layout worked out I can play with the design.
    If anyone wants, I can post a link to the basic index.php and the css for the site. Since it’s pretty stripped just for layout, it might be helpful as a starting point for someone wanting to do the same thing. If anyone wants it, let me know.

    Heck. A miracle. I helped someone on his layout. Tx for mentioning it helped a bit. Welcome to WP.

    Podz, thanx I used that, works for me too!

Viewing 15 replies - 1 through 15 (of 16 total)
  • The topic ‘Set body to fixed width?’ is closed to new replies.