html - CSS background color not appearing -
my webpage has footer 4 separate footer cols. separated 5px margin on right , left side. have green background. footer (containing element) has red background not appear. validated html , not find problem xhtml markup i'm assuming it's css woe.
fiddle: http://jsfiddle.net/48dk6/
footer css declarations.
/* footer , descendants */ #footer { font-size:1.3em; margin-top:10px; clear:both; background-color:red; } /* footer col styling/positioning */ .footercol { background-color:green; width:180px; float:left; margin:10px 5px 10px 5px; }
add overflow:auto
#footer
css:
#footer { font-size:1.3em; margin-top:10px; clear:both; background-color:red; overflow:auto; }
this restore behavior seek, caused children .footercol
divs being floated. floating child divs removes them normal flow, parent behaves if there nothing contain.
Comments
Post a Comment