關于頁面布局
我把這些刪了
#page:after,
#page:before{
? content:"";
? display: table;
}
#page:after{
? clear:both;
? overflow: hidden;
}
在下邊footer里加上?margin-top:20px;為什么footer和page之間沒有距離
我把這些刪了
#page:after,
#page:before{
? content:"";
? display: table;
}
#page:after{
? clear:both;
? overflow: hidden;
}
在下邊footer里加上?margin-top:20px;為什么footer和page之間沒有距離
2017-08-19
舉報
2017-08-20
你刪除的部分是偽元素清除浮動的樣式,上面兩個盒子明顯是浮動過得;如果你用伸縮布局就就不會出現這種情況
解決方法在main content和sidebar content的父盒子上設置display:flex,并且justify-content:space-between;
;再就是清除浮動給父盒子設置高,或者overflow:hidden;清除浮動一共有八種方法,不在一一敘述