<!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>无标题文档</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条经验 获得超754个赞
因为你设置了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
两个外边距仅在以下情况下叠加:
都属于常规文档流(in-flow)中的 block-level boxes,而且处于同一个块级格式化上下文
没有 line boxs 、clearance、padding 和 border 将其分隔(certain zero-height line boxes 除外)
都属于垂直方向上相邻的盒子的相邻外边距
- 3 回答
- 0 关注
- 1467 浏览
相关问题推荐
添加回答
举报
0/150
提交
取消