SitePoint Sponsor

User Tag List

Results 1 to 5 of 5

Thread: CSS centering

  1. #1
    SitePoint Enthusiast
    Join Date
    Jan 2004
    Location
    Hull
    Posts
    66
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    CSS centering

    just can't seem to get this to work! I've done it several times before but on this web page dlw.me.uk I can not get it to center in firefox, need it done by 8 in the morning to show at uni for 9 so if anyone has any ideas they would be greatlly appreciated.

    TIA

  2. #2
    SitePoint Addict
    Join Date
    Jun 2003
    Location
    Barrie, Ontario, Canada
    Posts
    316
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    If you want it to centre in firefox, change your code from this:
    Code:
    #wrap{
    margin: 2% 0 2% 0;
      width: 700px;
      background: #fff;
    }
    to this:
    Code:
    #wrap{
    margin: 2% auto 2% auto;
      width: 700px;
      background: #fff;
    }
    or

    Code:
    #wrap{
    margin: 2% auto;
      width: 700px;
      background: #fff;
    }

  3. #3
    SitePoint Enthusiast
    Join Date
    Jan 2004
    Location
    Hull
    Posts
    66
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    thanks so much, never would have go there without that help.

  4. #4
    Non-Member Egor's Avatar
    Join Date
    Jan 2004
    Location
    Melbourne, Australia
    Posts
    7,305
    Mentioned
    1 Post(s)
    Tagged
    1 Thread(s)
    Also remember if that this wont work in IE 5 and 5.5 I think.
    THe site will stick to the left still.

    To get it centered for these version you can do add this to your code:

    Code:
    body {text-align: center;}
    And then for every div you'll need to add "text-align: left"

  5. #5
    SitePoint Evangelist ClevaTreva's Avatar
    Join Date
    Jan 2004
    Location
    Chipping Campden, UK
    Posts
    403
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Hi

    And for older versions of IE5 Mac, you may need the auto's to be margin-right:auto and margin-left:auto rather than on one line




    Trevor
    "Good artists copy, great artists steal."
    - Pablo Picasso
    The image of ClevaTreva is drawn by Rhys, and is a GOOD likeness


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
  •