how do I center my web site

Discussion in 'Javascript' started by Pierre, Mar 2, 2004.

  1. Pierre

    Pierre Guest

    When I view the Yahoo site, with my brower setting at 1024 X 768 it is
    centered right in the middle with equal space on both side; and when I
    view it with my setting at 800 X 600 it fills the page perfectly.

    How can I achieve this ?
     
    Pierre, Mar 2, 2004
    #1
    1. Advertising

  2. Pierre

    Ivo Guest

    "Pierre" <> wrote in message
    news:...
    > When I view the Yahoo site, with my brower setting at 1024 X 768 it is
    > centered right in the middle with equal space on both side; and when I
    > view it with my setting at 800 X 600 it fills the page perfectly.
    >
    > How can I achieve this ?


    How do they do it? Have you looked at that?
    I may be wrong, but I suspect there is no javascript involved in the styling
    of said page. You may have better luch at a newsgroup like
    comp.infosystems.www.authoring.stylesheets or
    comp.infosystems.www.authoring.html, and even more so when you supply a
    sample of what you have, what and what you have tried to make it do what is
    supposed to do.
    HTH
    Ivo
     
    Ivo, Mar 2, 2004
    #2
    1. Advertising

  3. Pierre

    mayur Guest

    <body bgcolor="#FFFFFF" text="#000000" ><center>
    </center>
    </body>


    *** Sent via Developersdex http://www.developersdex.com ***
    Don't just participate in USENET...get rewarded for it!
     
    mayur, Mar 2, 2004
    #3
  4. mayur <> writes:

    > <body bgcolor="#FFFFFF" text="#000000" ><center>
    > </center>
    > </body>


    Ick! This might not be an HTML/CSS group, but I highly recommend using
    CSS for that, and never use the center tag.

    <body style="background:black;color:white;text-align:center;">
    <div style="width:780px;margin:5px auto;text-align:left;
    background:white;color:black;border:1px solid red;">
    Some content that is in the centered div.
    </div>
    </body>

    The trick to centering is to have left and right margins of auto. It
    won't work in IEs prior to version 6, and then only in standards mode.
    For those other IEs, their incorrect treatement of the
    text-align-property can be used as a hack to center the div anyway.

    /L
    --
    Lasse Reichstein Nielsen -
    DHTML Death Colors: <URL:http://www.infimum.dk/HTML/rasterTriangleDOM.html>
    'Faith without judgement merely degrades the spirit divine.'
     
    Lasse Reichstein Nielsen, Mar 2, 2004
    #4
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. mike kim
    Replies:
    2
    Views:
    564
    clintonG
    Aug 20, 2003
  2. Tiddley-Pom
    Replies:
    5
    Views:
    440
    Mark Parnell
    Oct 15, 2003
  3. Eirik Eldorsen
    Replies:
    17
    Views:
    12,567
    cosmic foo
    Aug 4, 2005
  4. mark4asp
    Replies:
    1
    Views:
    1,198
    Steve C. Orr [MCSD, MVP, CSM, ASP Insider]
    Mar 24, 2007
  5. Replies:
    0
    Views:
    460
Loading...

Share This Page