htmlbbbbbbbcssbody{padding:0;margin:0;}.a{background:red;}.b{background:blue;margin-top:10px;}http://jsfiddle.net/nhk6g1qx/1/父標簽高度沒有被撐開但留出了10像素的高度而給a增加padding-top:10紅色背景頂部出現了20的高度http://jsfiddle.net/nhk6g1qx/4/
子標簽的margintop為什么不能撐開父標簽的高度?
郎朗坤
2019-04-19 15:58:56