← 技术宅社区
噢!麦嘎
DIV+CSS里 为什么会出现这种情况。。求教

本帖最后由 噢!麦嘎 于 2013-1-30 16:11 编辑

为什么 做一个

<div class="大IDV">

<div class=“小DIV”>在小的DIV里设置与上边距为20(margin-TOP:20px;),为什么整个大的DIV全都下沉,而不是只有这个下沉呢?</di

【查看更多内容请登录哈】

展开
完整版
噢!麦嘎

本帖最后由 噢!麦嘎 于 2013-1-22 15:43 编辑

pockry 发表于 2013-1-22 14:09 【链接登录后可见】

你说的难道是这个?

margin:0 auto;

margin-top:20px;

内容我删了 怕被管理员说广告。。。

[查看全文]
展开
噢!麦嘎

pockry 发表于 2013-1-22 14:09 【链接登录后可见】

你说的难道是这个?

margin:0 auto;

margin-top:20px;

。。。太复杂了 我用了 不行

想把整个贴出来 又怕说打广告。。。。。!1!!4!

[查看全文]
展开
pockry

你说的难道是这个?

margin:0 auto;

margin-top:20px;

单边定义会被整体定义覆盖。 你用margin:20px auto 0 auto;

[查看全文]
展开
噢!麦嘎

本帖最后由 噢!麦嘎 于 2013-1-22 14:04 编辑

[mw_shl_code=xhtml,true]

.con {

height:3000px;

background:url(images/bg.gif);

backgroun

【查看更多内容请登录哈】

[查看全文]
展开
广场登录完整版