代码很简单。两个模范元素有底边距。 但是,在chrome中,边距覆盖.line元素。 我认为应在.line上的空白处放置边距。 是Chrome的显示错误吗?
<!doctype html>
<html lang="en">
<head>
<style>
html, body {margin: 0}
.line{height:50px;background:red;}
.mb{margin-bottom:50px;}
</style>
</head>
<body>
<div id="first" class="mb"></div>
<div id="second" class="mb"></div>
<div class="line"></div>
</body></html>
<!doctype html>
<html lang="en">
<head>
<style>
html, body {margin: 0}
.line{height:50px;background:red;}
.mb{margin-bottom:50px;}
</style>
</head>
<body>
<div id="first" class="mb"></div>
<div id="second" class="mb"></div>
<div class="line"></div>
</body></html>
html is of height 100px #first overlaps .line #second overlapys .line