Here there is the whole example of my divs.
Why doesn’t footer get the background color from the parent (container)?
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
When you
floatan element, this is like it was disconnected from the parent. So,inheritvalues cannot be inherited. Also, the parent stops expanding to the children heights. Remove thefloatand you can see it working.But if you really need the
float, you need to putbackground-coloronfooter.Remember that you can put another
<div style="clear: both"></div>afterfooterlike showed on another answer, but it is just a trick to that the parent can follow the child height.