WEB CSS Help Please! v. centering works in FF but no IE

Discussion in 'OT Technology' started by dawgboye, Jan 15, 2008.

  1. dawgboye

    dawgboye I'm a businessman who's commodity happens to be co

    Joined:
    Jan 16, 2006
    Messages:
    7,971
    Likes Received:
    0
    Location:
    A Smart Part of Town.
    Code:
    .registration {
        position: absolute;
        top: 0;
        right: 0;
        bottom: 0;
        left: 0;
        margin: auto;
        color: #333;
        display: none;
        width: 550px;
        height: 550px;
        border: 10px solid #ca7f20;
        background-color: #fff;
        text-align: left;
        z-index:1001;
        overflow: hidden;    
    }
    
    Works great in FF but is to the top and left in IE.
     
  2. kingtoad

    kingtoad OT Supporter

    Joined:
    Sep 2, 2003
    Messages:
    55,924
    Likes Received:
    11
    Location:
    Los Angeles
    Holy shit.

    If all you need to do is center a div, do this:

    Code:
    .registration {
      width: 550px;
      margin: 0px auto;
    }
    
     
  3. dawgboye

    dawgboye I'm a businessman who's commodity happens to be co

    Joined:
    Jan 16, 2006
    Messages:
    7,971
    Likes Received:
    0
    Location:
    A Smart Part of Town.
    That still has it to the top and left in IE

    It also moved it to the top in FF (which is fine, I dont really care about that).
     
  4. kingtoad

    kingtoad OT Supporter

    Joined:
    Sep 2, 2003
    Messages:
    55,924
    Likes Received:
    11
    Location:
    Los Angeles
    Wirelessly posted via wap.offtopic.com (lolphone: Mozilla/5.0 (iPhone; U; CPU like Mac OS X; en) AppleWebKit/420.1 (KHTML, like Gecko) Version/3.0 Mobile/3B48b Safari/419.3)

    no. The code I gave you will work.

    You shouldnt ever need to absolute position like that.
     
  5. kingtoad

    kingtoad OT Supporter

    Joined:
    Sep 2, 2003
    Messages:
    55,924
    Likes Received:
    11
    Location:
    Los Angeles
    Wirelessly posted via wap.offtopic.com (lolphone: Mozilla/5.0 (iPhone; U; CPU like Mac OS X; en) AppleWebKit/420.1 (KHTML, like Gecko) Version/3.0 Mobile/3B48b Safari/419.3)

    And WTF is up with your z-index? lol.
     
  6. dawgboye

    dawgboye I'm a businessman who's commodity happens to be co

    Joined:
    Jan 16, 2006
    Messages:
    7,971
    Likes Received:
    0
    Location:
    A Smart Part of Town.
    got it,thanks folks
     
  7. dawgboye

    dawgboye I'm a businessman who's commodity happens to be co

    Joined:
    Jan 16, 2006
    Messages:
    7,971
    Likes Received:
    0
    Location:
    A Smart Part of Town.
    What you gave me didn't work, but I appreciate it anyway.

    The z-index was there originally from the script (leightbox).

    The solution that ended up working was setting the left positioning 50% and then having a left margin of half the width of the box for the overlay.

    Works great now, in both browsers (go figure)
     
  8. kingtoad

    kingtoad OT Supporter

    Joined:
    Sep 2, 2003
    Messages:
    55,924
    Likes Received:
    11
    Location:
    Los Angeles

Share This Page