3 回答

TA貢獻(xiàn)446條經(jīng)驗(yàn) 獲得超754個(gè)贊
因?yàn)槟阍O(shè)置了border。
W3C原文:
Two margins are?adjoining?if and only if:
both belong to in-flow?block-level boxes?that participate in the same?block formatting context
no line boxes, no clearance, no padding and no border separate them?(Note that?certain zero-height line boxes?(see?9.4.2) are ignored for this purpose.)
both belong to vertically-adjacent box edges
兩個(gè)外邊距僅在以下情況下疊加:
都屬于常規(guī)文檔流(in-flow)中的 block-level boxes,而且處于同一個(gè)塊級(jí)格式化上下文
沒有 line boxs 、clearance、padding 和 border 將其分隔(certain zero-height line boxes 除外)
都屬于垂直方向上相鄰的盒子的相鄰?fù)膺吘?/p>
添加回答
舉報(bào)