Make outer div expand with inner div

Problem

I have two divs, one inside the other. I make the inner div have a height of 100px. The problem is that the outer div does not expand to 100px.  Instead it stays at 0px height.

Solution

In order for the outer div to expand with the inner div, you must have the following:

  1. Don’t state a height
  2. Enclose elements with Float
  3. Don’t use absolute positioning

source: http://forums.devshed.com/css-help-116/trying-to-make-div-expand-as-div-within-expands-508432.html
keywords: css expand outer div

Tagged with:

Leave a Reply