1. Advertising
    y u no do it?

    Advertising (learn more)

    Advertise virtually anything here, with CPM banner ads, CPM email ads and CPC contextual links. You can target relevant areas of the site and show ads based on geographical location of the user if you wish.

    Starts at just $1 per CPM or $0.10 per CPC.

Nesting DIVs

Discussion in 'CSS' started by gamerfreak, Sep 6, 2009.

  1. #1
    Hey, I'm having an issue nesting DIVs.....

    CSS:
    #content {
       background: #FFFFFF;
       border-top: 3px solid #000000;
       border-bottom: 3px solid #000000;
       padding: 20px;
       padding-top: 0px;
    }
    #rightpane {
    float:right;
    width: 120px;
    background: #ECE9D8;
    }
    Code (markup):
    HTML:
    <div id="wrapper">
       <div id="content">
          <div id="rightpane">
          </div>
       </div>
    </div>
    Code (markup):
    The issue I am having (aside from my weak CSS skills) is that the "content" DIV is not scaling verticly with the "rightpane" DIV.....

    [​IMG]

    Any suggestions for fixing this?
     
    gamerfreak, Sep 6, 2009 IP
  2. wd_2k6

    wd_2k6 Peon

    Messages:
    1,740
    Likes Received:
    54
    Best Answers:
    0
    Trophy Points:
    0
    #2
    Yup you need to enclose your floats , the most common way to do this is just to add overflow:auto; to your #content.
     
    wd_2k6, Sep 6, 2009 IP
    gamerfreak likes this.
  3. gamerfreak

    gamerfreak Well-Known Member

    Messages:
    250
    Likes Received:
    14
    Best Answers:
    0
    Trophy Points:
    110
    #3
    Thanks, worked perfectly!!
     
    gamerfreak, Sep 6, 2009 IP