6 Replies Latest reply on Feb 6, 2010 11:35 AM by Nancy OShea

    Fundamental Confusion (about float and height) - please help

    cripaustin Level 1

      hi. desired result is: a floated, fixed height and

      width div nested in another div with auto height and fixed width. but why does the mainbox div (see example) just collapse. am i missing a fundamental basic knowledge base here?

       

      <style type="text/css">
      #mainbox {width:300px; height:auto; background: #CCC}
      #mainbox .inside1 {width:100px; height:200px; float:left}</style>
      </head>

      <body>
      <div id="mainbox"><div class="inside1"></div></div>
      </body>
      </html>

      thanks.

       

      {Subject edited for clarity by moderator]