问题
Can anyone tell me why the background color 'black' isn't being picked up on the footer of this website in IE7?
http://james-gilmore.co.uk/index.html
回答1:
Probably the hasLayout bug - have a quick read of this:
http://www.satzansatz.de/cssd/onhavinglayout.html
Try adding height:1%
回答2:
The footer container has all floated children inside and therefore has no height. You need to clear the floats. There are many ways to do this, ranging from adding a clearfix class to the container or simply adding overflow:hidden
Also related - Background not showing behind floating divs
回答3:
It's probably worth just using the hex value #000000
instead of black
, and see if that fixes the issue.
IE7 is pretty lame sometimes...
来源:https://stackoverflow.com/questions/13311826/ie7-background-color-issue