【发布时间】:2010-12-21 07:08:59
【问题描述】:
这是我的 CSS(简化版):
body {
background: url('bg.gif') left top;
}
#content {
background: #ddd;
}
.box {
overflow: hidden;
margin-top: 10px;
background: #1e1e1e url('left-bottom-corner.gif') left bottom no-repeat;
}
还有标记:
<div id="content">
<div class="box">
<p>lorem ipsum</p>
</div>
</div>
现在的问题。在 .box 上边距为 10px 的地方,#content div 的背景是不可见的,而 body 的背景是可见的。
我不能使用填充,因为我需要将 .box div 设置为具有圆形边框和它们自己的背景,所以我必须使用边距。
如何解决这种不正确的行为?
【问题讨论】:
标签: css