
噢!麦嘎
DIV+CSS里 为什么会出现这种情况。。求教
>>
完整版
本帖最后由 噢!麦嘎 于 2013-1-30 16:11 编辑
为什么 做一个
<div class="大IDV">
<div class=“小DIV”>在小的DIV里设置与上边距为20(margin-TOP:20px;),为什么整个大的DIV全都下沉,而不是只有这个下沉呢?</div>
</div>
问题已解决:外边距合并问题,只有普通文档流中块框的垂直外边距才会发生外边距合并。行内框、浮动框或绝对定位之间的外边距不会合并。!108!
刚刚看教程看到了。。哭~
噢!麦嘎
噢!麦嘎
pockry
噢!麦嘎
本帖最后由
展开Biu
本帖最后由 噢!麦嘎 于 2013-1-22 14:04 编辑
[mw_shl_code=xhtml,true]
.con {
height:3000px;
background:url(images/bg.gif);
background-position:center;
margin:0 auto;
}
.con_dy {
width:980px;
height:100px;
margin:0 auto;
margin-top:20px;
background:url(images/dy_zuo.gif) no-repeat;
}
[/mw_shl_code]
CON是大的DIV,CON_DY它里面的一个小IDV
为什么在小的DIV里调协了margin-top:20px; 然后整个CON整体下沉了呢?
[查看全文]