Div doesn’t expand to contain elements
I’ve always found this odd, though it is correct behaviour. You have a div, with other elements inside it, but the div doesn’t seem to “contain” these items when looking at the layout via firebug or some other tool. The inner elements overflow the div element. The div element won’t expand automatically, you need to add overflow:auto; to your div for this. Now the div will automatically expand to contain the inner elements.
This is particularly handy if you want to use borders on your div for styling.





