這裏是我的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的背景是不可見的,相反,主體的背景是可見的。
我無法使用填充,因爲我需要將.box divs設置爲具有圓形邊框和自己的背景,所以我必須使用邊距。
我該如何解決這個不正確的行爲?
看到這裏:http://stackoverflow.com/questions/315738/unexpected-margin-with-very-simple-html – mercator 2009-11-28 22:21:01