Pages

Thursday, May 29, 2014

Background color not appearing in div element

A floating element doesn't affect the size of the parent, unless the parent specifically contain the children using the overflow style.

Your outer div has the same background colors as the child divs, but the height of the parent is zero, so you don't see its background.

div { background: #ccc; overflow: hidden; }

No comments:

Post a Comment