Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 4 of 4
  1. #1
    New Coder
    Join Date
    Aug 2003
    Posts
    13
    Thanks
    0
    Thanked 0 Times in 0 Posts

    1 small question

    I built a website that is 800px wide, how do i make it stay centered in other resolutions like 1024x768?

    www.bluesfear.com <== thats what im talking about if im being to vague.

  • #2
    Regular Coder
    Join Date
    May 2003
    Location
    Manassas, VA, USA
    Posts
    220
    Thanks
    0
    Thanked 0 Times in 0 Posts
    <div align="center">
    Your content
    </div>

    -Andrew
    Get the best Web Design books called Visual QuickStart Guides at the Peachpit Press
    Ithium Web Hosting

  • #3
    Senior Coder
    Join Date
    Jun 2002
    Location
    The Netherlands, Baarn, Ut.
    Posts
    4,252
    Thanks
    0
    Thanked 0 Times in 0 Posts

    CSS, please...

    Since the align attribute is deprecated, from a separate-content-from-presentation point of view, the preferred method would be to specify margin-left: auto; margin-right; auto for the element containing your content (typically a div); since IE doesn't buy this, for it to play nice you can specify text-align: center for the element containing the container element (body?), then for the container element text alignment can be corrected again if needed.
    Last edited by ronaldb66; 03-08-2004 at 02:19 PM.
    Regards,
    Ronald.
    ronaldvanderwijden.com

  • #4
    Senior Coder
    Join Date
    Oct 2003
    Location
    Australia
    Posts
    1,963
    Thanks
    0
    Thanked 0 Times in 0 Posts
    And just to make what ronald said a little more clear....
    Code:
    <body>
        <div id="container">
            .......current layout goes here.......
        </div>
    </body>
    _________________________________
    /*--------CSS-----------*/
    
    body{text-align:center;}
    
    #container{
             margin:0 auto;
             text-align: left;
     }

    I take no responsibility for the above nonsense.


    Left Justified


  •  

    Posting Permissions

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