热搜:NVER node 开发 php

子级div使用了margin-top,连父级div都应用到了?_html/css_WEB-ITnose

2024-07-22 21:00:02
子级div使用了margin-top,连父级div都应用到了?_html/css_WEB-ITnose

本帖最后由 phf0313 于 2011-10-21 12:27:24 编辑

        	            	                    

.qiandao {	width:210px;	height:267px;	background:url(http://192.168.1.3/image/my_qd_bg.jpg) no-repeat;}.qd_circle {	border:1px solid #d0ccc3;	width:196px;	height:35px;	margin-top:6px;	margin-left:5px;	}

qd_circle用了margin-top,但是qiandao也被撑下来了,求解?

回复讨论(解决方案)

恩 如果 父标签有边框的 话 在有些浏览器中直接把边框干断 用padding   子标签用padding不方便那就用在父标签上,  

.qiandao {
    width:210px;
    height:267px;
    background:url(http://192.168.1.3/image/my_qd_bg.jpg) no-repeat;
overflow:hidden
}
.qd_circle {
    border:1px solid #d0ccc3;
    width:196px;
    height:35px;
    margin-top:6px;
    margin-left:5px;    
}

google 垂直边距叠加/压缩

父div设置overflow:hidden就可以