WordPress.org

Ready to get started?Download WordPress

Forums

Set body to fixed width? (17 posts)

  1. Anonymous
    Unregistered
    Posted 10 years ago #

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

  2. Mark (podz)
    Support Maven
    Posted 10 years ago #

    body {
    margin-left: auto;
    margin-right: auto;
    width: 750px;
    }
    Add other attributes as required (border etc)

  3. Mark (podz)
    Support Maven
    Posted 10 years ago #

  4. Root
    Member
    Posted 10 years ago #

    @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.

  5. GeckoX
    Member
    Posted 10 years ago #

    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?

  6. sakamuyo
    Member
    Posted 10 years ago #

    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.

  7. GeckoX
    Member
    Posted 10 years ago #

    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.

  8. Mark (podz)
    Support Maven
    Posted 10 years ago #

    Do you have a link ?
    Maybe we can help you out :)

  9. Mark (podz)
    Support Maven
    Posted 10 years ago #

    grab the css :)
    http://www.tamba2.org.uk/T2/wp-layout.css
    It's actually wp_new (from Alex Kings styles page) but with my poor graphic in the top and things a bit wider ....

  10. GeckoX
    Member
    Posted 10 years ago #

    Thanks, I'll try that. Nice page btw. Liked the "body art" links.

  11. Mark (podz)
    Support Maven
    Posted 10 years ago #

    Thanks !

  12. Mark (podz)
    Support Maven
    Posted 10 years ago #

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

  13. Root
    Member
    Posted 10 years ago #

    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.

  14. Anonymous
    Unregistered
    Posted 10 years ago #

    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.

  15. Root
    Member
    Posted 10 years ago #

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

  16. gaijindo
    Member
    Posted 8 years ago #

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

  17. Wow, a 26 month post bump. :|

Topic Closed

This topic has been closed to new replies.

About this Topic

Tags

No tags yet.