喵宅苑 MewoGarden × 技术宅社区II | Z站 Z Station 棒棒哒纯文字二次元技术社区

正文

DIV+CSS里 为什么会出现这种情况。。求教

作者:噢!麦嘎
[i=s] 本帖最后由 噢!麦嘎 于 2013-1-30 16:11 编辑 为什么 做一个 <div class="大IDV"> <div class=“小DIV”>在小的DIV里设置与上边距为20(margin-TOP:20px;),为什么整个大的DIV全都下沉,而不是只有这个下沉呢?</div> </div> 召唤高手。。@pocketj @銀琉迦 @百里叮 问题已解决:外边距合并问题,只有普通文档流中块框的垂直外边距才会发生外边距合并。行内框、浮动框或绝对定位之间的外边距不会合并。!108! 刚刚看教程看到了。。哭~

回复

我的怎么就没有

作者:Mr_Alex
我的怎么就没有。。。。。
查看回复

那我要努力学习

作者:噢!麦嘎
百里叮 发表于 2013-1-22 14:35 那我要努力学习!
干吧呆~~!103! 继续纠结~~!1!
查看回复

不懂也可以来凑个热闹啦

作者:百里叮
噢!麦嘎 发表于 2013-1-22 14:34 不懂也可以来凑个热闹啦~~
:22:那我要努力学习!
查看回复

伦家不懂啦

作者:噢!麦嘎
百里叮 发表于 2013-1-22 14:33 麦麦,伦家不懂啦
不懂也可以来凑个热闹啦~~!105!
查看回复

伦家不懂啦

作者:百里叮
:43:麦麦,伦家不懂啦
查看回复

你说的难道是这个

作者:噢!麦嘎
pockry 发表于 2013-1-22 14:09 你说的难道是这个? margin:0 auto; margin-top:20px;
补充一句: 在IE6里 却是正常的。。。!12!
查看回复

你说的难道是这个

作者:噢!麦嘎
pockry 发表于 2013-1-22 14:09 你说的难道是这个? margin:0 auto; margin-top:20px;
你帮我看下效果出来的样子。。。。。 就是 导航以下的整体DIV,本来是好好的 下面 紧贴着导航 但是我做了那个宽980高100的块 然后在里面填充了一张小图片 想要让小图片与上边距有20的空白 结果加了之后 整个导航以下的内容全都下沉了。。。 !1!
查看回复

本帖最后由

作者:噢!麦嘎
[i=s] 本帖最后由 风音洛洛 于 2013-1-22 16:00 编辑
pockry 发表于 2013-1-22 14:09 你说的难道是这个? margin:0 auto; margin-top:20px;
[mw_shl_code=css,true]body { margin:0 auto; padding:0px; font-size:12px; border:0px; } .top a { text-decoration:none; color:#c8e1ff; } .top a:hover { text-decoration:underline; } .top { height:45px; background:#426ca9; } .top_nr { width:1000px; height:45px; margin:0 auto; color:#c8e1ff; line-height:45px; } .top span { float:left; } .top ul { width:200px; height:45px; margin:auto; margin-left:330px; float:left; } .top ul li { height:45px; list-style-type:none; float:left; padding-left:3px; padding-right:3px; } .qq { width:107px; height:26px; float:left; margin-top:10px; } .head { height:367px; background:url(images/banner_jb.gif); } .banner { height:367px; background:url(images/banner.png) no-repeat; background-position:center; } .banner a { width:151px; height:44px; margin-left:1070px; margin-top:300px; float:left; } .nav a{ color:#FFFFFF; text-decoration:none; } .nav a:hover { text-decoration:underline; } .nav { height:51px; background:url(images/nav_jb.gif); } .nav_z { width:1002px; height:51px; background:url(images/nav.png) no-repeat; margin:0 auto; line-height:51px; } .nav ul { float:left; margin:0 auto; padding:0px; padding-left:50px; } .nav ul li { font-size:14px; color:#FFFFFF; font-weight:bold; float:left; padding-left:4px; padding-right:4px; list-style-type:none; } .con { height:3000px; background:url(images/bg.gif); background-position:center; margin:0 auto; } .con_dy { width:980px; height:100px; margin-top:20px; background:url(images/dy_zuo.gif) no-repeat; } [/mw_shl_code]
查看回复
上一页
下一页
0%
站点地图友情链接:
喵宅苑
喵空间社区程序
喵宅苑 静态版
宅喵RPG地图编辑器
络合兔
Lanzainc
技术宅
小五四博客
莉可POI
Mithril.js
枫の主题社
Project1
午后少年
机智库
七濑胡桃
xiuno
幻想の日常
魂研社
Nothentai
0xffff
欲望之花
泽泽社长
淀粉月刊
HAYOU