当前位置:Gxlcms > html代码 > css浮动问题_html/css_WEB-ITnose

css浮动问题_html/css_WEB-ITnose

时间:2021-07-01 10:21:17 帮助过:26人阅读







#a{
height:auto!important;
height:800px;
min-height:800px;
width:1015px;
margin:0 auto;
border:1px solid #B10000;
}

#b{
height:auto!important;
height:600px;
min-height:600px;
width:831px;
border:1px solid #DFDFDF;
float:left;
}

请问高手怎么样才能让b的内容大于800px时,撑开a,
注加Div都行,只要能撑开。


回复讨论(解决方案)

撑开a 是上面意思呢

a.width = b.width+215吗

不是意思,是高度

a中仅设置min-height:800px;,,,height不要写。。。

#a{	height:auto!important;        height:800px;       min-height:800px;width:1015px;	margin:0 auto;	border:1px solid #B10000;overflow:auto;}

试一下吧。。。。。

#a{
height:auto!important;
height:800px;
min-height:800px;
width:1015px;
margin:0 auto;
border:1px solid #B10000;
overflow:auto;
}

规范很重要!
有浮动了,难道不清除吗?
清除浮动,问题迎刃而解,overflow什么的根本不需要写。

人气教程排行