給子元素margin-top時,若這個子元素前面沒有其他內容,這個margin-top值會應用到父元素上
解決方案,給父元素設置:before
body:before{
content: "";
display: table;
/*或者display: inline-block;*/
}
給子元素margin-top時,若這個子元素前面沒有其他內容,這個margin-top值會應用到父元素上
解決方案,給父元素設置:before
body:before{
content: "";
display: table;
/*或者display: inline-block;*/
}