為什么這個代碼去掉clear后footer還是受浮動影響?
#mainbody{width:100%;background:#123;overflow:hidden;}
#lside{width:800px;height:400px;background:#000;float:left;}
#rside{width:140px;height:600px;background:#789;float:right}
#footer{background:#bbc;clear:both;}
#mainbody{width:100%;background:#123;overflow:hidden;}
#lside{width:800px;height:400px;background:#000;float:left;}
#rside{width:140px;height:600px;background:#789;float:right}
#footer{background:#bbc;clear:both;}
2016-03-10
舉報
2016-03-11
clear就是防止footer受浮動影響的。為什么要去掉呢?