<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><html xmlns="http://www.w3.org/1999/xhtml"><head><meta http-equiv="Content-Type" content="text/html; charset=utf-8" /><title>無標(biāo)題文檔</title><style>?a[title]{ border-bottom:1px dotted #999; } a[title]:hover, a[title]:focus{ cursor:help; } .box1{ background:#234; border:1px solid? #000; height:50px; width:50px; margin:30px; } .box2{ background:#F00; height:50px; width:50px; margin:20px;}</style></head><body><p>The term <a href="#" title="self-contained underwater breathing apparatus">SCUBA </a> ?is an aconym rather than an abbreviation as it is as a word.</p><div class="box1"><div class="box2"></div></div></body></html>
3 回答
已采納

qq_青棗工作室_0
TA貢獻446條經(jīng)驗 獲得超754個贊
因為你設(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
兩個外邊距僅在以下情況下疊加:
都屬于常規(guī)文檔流(in-flow)中的 block-level boxes,而且處于同一個塊級格式化上下文
沒有 line boxs 、clearance、padding 和 border 將其分隔(certain zero-height line boxes 除外)
都屬于垂直方向上相鄰的盒子的相鄰?fù)膺吘?/p>
添加回答
舉報
0/150
提交
取消