Results 1 to 3 of 3

Thread: Positioning content in the middle (no movable space on right)

  1. #1
    Join Date
    Jun 2009
    Posts
    4
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Red face Positioning content in the middle (no movable space on right)

    Hello, thank

    I'm wondering how to position the website content in the middle and how to content not movable? For example, on my website, ( www.bonniechoigallery.com) I can get empty space on the right eternally if I enlarge the window to the right side. So, all the content which supposed to be positioning in the middle don't position where it should be... also, whenever I open the window with different browser, it gets different shape and size....... I set the right and left margins to 0, but unfortunately, that seemed to not enough solution to fix this. Could you please please let me know how to fix that problem? My background body is jpeg file. And, the width of window is 1000.


    Thank you so much for your help and could I look forward to hearing from you?


    Best Regards and Many Thanks
    Bonnie

  2. #2
    Join Date
    Apr 2009
    Location
    Mac OSX
    Posts
    14
    Thanks
    1
    Thanked 0 Times in 0 Posts

    Default

    use css margins mate!

    Code:
    <style type="text/css">
    
    div {
    margin-left: 150px;
    margin-right: 150px;
    }
    </style>
    
    <div>
    This is a marginalized text :D
    </div>

  3. #3
    Join Date
    Apr 2009
    Location
    Sydney, Australia
    Posts
    118
    Thanks
    16
    Thanked 1 Time in 1 Post

    Default

    The simple answer to center content is to use...

    Code:
    <div style="margin:0 auto;background-color:red;width:600px;height:600px;">
    CONTENT HERE
    </div>
    for the main container. I added the background color for visual effect.
    margin: 0 auto; centers the container, so you should ensure the <div> contains all your other block-level elements and content. This should keep the container centered on browser resize.

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •