#footer { width:100%; height:80px; position:absolute; bottom:0; left:0; background:green;clear: both; }
#body 包含浮子元素是他们之后的明显缺失。
#body
你可以解决这个问题 overflow: hidden; 至 #body 例如(有更多选项)。
overflow: hidden;
#body {overflow: hidden}
要么 clear: both 至 footer 应该有所帮助
clear: both
footer
footer {clear: both}
在div上应用CSS#footer -
div#footer { bottom: 0; clear: both; height: 200px; position: fixed; width: 100%;
}