WEB div floating issue.

Discussion in 'OT Technology' started by drpepper, Nov 21, 2008.

  1. drpepper

    drpepper Active Member

    Joined:
    Nov 13, 2006
    Messages:
    38,076
    Likes Received:
    2
    Location:
    San Antonio
    i have my main div.
    i have sub divs withing in being floated left/right etc as needed.
    now, for my main div i have margin: 0 auto; to it can center.

    now, if i dont float my main div, it will not stretch and encompass all my other divs. it will just sit at the top, but still centered.

    if i float it left or right, it encompasses the other divs, but its not centered anymore, obviously. any easy way around this?
     
  2. kingtoad

    kingtoad OT Supporter

    Joined:
    Sep 2, 2003
    Messages:
    55,914
    Likes Received:
    8
    Location:
    Los Angeles
    Add:
    Code:
    overflow: hidden;
    
    To your main div.
     
  3. drpepper

    drpepper Active Member

    Joined:
    Nov 13, 2006
    Messages:
    38,076
    Likes Received:
    2
    Location:
    San Antonio
    no :sad2:

    i remember fixing this same issue i had last time, but i forgot
     
  4. kingtoad

    kingtoad OT Supporter

    Joined:
    Sep 2, 2003
    Messages:
    55,914
    Likes Received:
    8
    Location:
    Los Angeles
    Do you have a static width set on the main div?
     
  5. drpepper

    drpepper Active Member

    Joined:
    Nov 13, 2006
    Messages:
    38,076
    Likes Received:
    2
    Location:
    San Antonio
    yea @ 1000px
     
  6. drpepper

    drpepper Active Member

    Joined:
    Nov 13, 2006
    Messages:
    38,076
    Likes Received:
    2
    Location:
    San Antonio
    Code:
    #wrapper {
    width: 1000px;
    background-image: url('images/bg.png');
    background-repeat: repeat-y;
    margin:0px auto;
    float: left;
    }
    
     
  7. drpepper

    drpepper Active Member

    Joined:
    Nov 13, 2006
    Messages:
    38,076
    Likes Received:
    2
    Location:
    San Antonio
    well apparently clear: both; on the footer works.
     
  8. kingtoad

    kingtoad OT Supporter

    Joined:
    Sep 2, 2003
    Messages:
    55,914
    Likes Received:
    8
    Location:
    Los Angeles
    Post the link.
     
  9. drpepper

    drpepper Active Member

    Joined:
    Nov 13, 2006
    Messages:
    38,076
    Likes Received:
    2
    Location:
    San Antonio
    its a localhost wp install :o
     
  10. drpepper

    drpepper Active Member

    Joined:
    Nov 13, 2006
    Messages:
    38,076
    Likes Received:
    2
    Location:
    San Antonio
    having a <div class="spacer" /> with clear: both seems like an ok workaround.
    it still doesnt center on IE tho.
     

Share This Page