SitePoint Sponsor

User Tag List

Results 1 to 8 of 8
  1. #1
    Web Design Addict
    Join Date
    Mar 2004
    Posts
    2,159
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    site is aligned left...should be center

    here is the address....

    www.geocities.com/deronsizemore/index5.htm

    I don't know why. It does it in IE 5.5. All above that it seems to be fine.

    Thanks,
    Deron

  2. #2
    Put your best practices away. The New Guy's Avatar
    Join Date
    Sep 2002
    Location
    Canada
    Posts
    2,087
    Mentioned
    1 Post(s)
    Tagged
    1 Thread(s)
    In the body tag put text-align: center; and in #container put text-align: left;

    That should fix it.
    "A nerd who gets contacts
    and a trendy hair cut is still a nerd"

    - Stephen Colbert on Apple Users

  3. #3
    Web Design Addict
    Join Date
    Mar 2004
    Posts
    2,159
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    why text-align: left; in the body tag?

  4. #4
    Put your best practices away. The New Guy's Avatar
    Join Date
    Sep 2002
    Location
    Canada
    Posts
    2,087
    Mentioned
    1 Post(s)
    Tagged
    1 Thread(s)
    No, text-align: center; in the body tag.
    "A nerd who gets contacts
    and a trendy hair cut is still a nerd"

    - Stephen Colbert on Apple Users

  5. #5
    Web Design Addict
    Join Date
    Mar 2004
    Posts
    2,159
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    my bad...I meant #container

  6. #6
    Put your best practices away. The New Guy's Avatar
    Join Date
    Sep 2002
    Location
    Canada
    Posts
    2,087
    Mentioned
    1 Post(s)
    Tagged
    1 Thread(s)
    otherwise everything contained in #container will be text-align: center;
    "A nerd who gets contacts
    and a trendy hair cut is still a nerd"

    - Stephen Colbert on Apple Users

  7. #7
    SitePoint Enthusiast yodaddy's Avatar
    Join Date
    Aug 2004
    Location
    georgetown, tx
    Posts
    86
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Just to clarify, the
    HTML Code:
    text-align: left;
    is so that the text within your body is not also centered in the middle of the page. Are you still confused or is this a dead discussion?

    Edit: oops, The New Guy beat me...

  8. #8
    The CSS Clinic is open silver trophybronze trophy
    Paul O'B's Avatar
    Join Date
    Jan 2003
    Location
    Hampshire UK
    Posts
    40,296
    Mentioned
    179 Post(s)
    Tagged
    6 Thread(s)
    Deron have a look at the FAQ sticky thread on centering if you are still unsure

    IE 5 and 5.5. (and ie6 in quirks mode) cdon't understand margin-left:auto and margin-right:auto and don't realise that is should centre block level elements that have a specified width.

    Instead they wrongly assume that text-align:center not only centres text but nested block level elements as well. Which is why you need text-align:center on a parent such as the body in order to centre the element nested within.

    Of course you then need to set the text back to text-align:left for the nested element otherwise the text will be centred as well.

    Paul


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
  •