【发布时间】:2017-02-25 03:47:19
【问题描述】:
我试图将另一个 div 中的 div 向下移动一点,但是当我使用时
margin-top: 10px;
它在顶部形成一个白色间隙。这是html:
<div id="topb">
<div id="selection">
</div>
</div>
这是 CSS:
#topb {
background: url(images/tomato-background.jpg) no-repeat fixed;
background-size: cover;
height: 100%;
width: 101%;
margin-left: -10px;
}
#selection {
background-color: #4d4d4d;
width: 60%;
height: 500px;
margin: auto;
margin-top: 40px;
}
【问题讨论】:
-
看起来您在#selection 中有 40px 的边距顶部。您的 10px 边距顶部在哪里?