我有 2 个 div 的问题 - 两个呈现为 block 的边距均为 15px(顶部 div 有底部边距,底部有顶部),因此我预计两者之间的差距是 30px 而不是 15px,这是正确的假设还是我要疯了!?
干杯 保罗
最佳答案
CSS box model定义 collapsing margins 的行为,这是所有浏览器的预期行为。
You might also find my answer to this related question to be of use .
关于CSS - margin 对 margin ,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/7433136/