div怎样可以自动增长

来源:百度知道 编辑:UC知道 时间:2024/05/31 06:58:53
div怎样可以自动增长?要在ie和火狐中有相同的效果!
我现在的是div中的ul有float:left,在ie可以自动增长,火狐不行,如果没有有float:left,在ie和火狐中就相同了,都可以自动增长!
但是我现在要有float:left;并且需要在ie和火狐中有相同的效果,都可以自动增长!

<style type="text/css">
.text{ float:left; height:200px; width:100%; background:red;}
.txt{ background:#0f0;width:90%; border:1px blue solid; overflow:auto;}
</style>

<div class="txt">
<div class="text"></div>
<div class="text"></div>
</div>

关键是overflow:auto;其他的都是为了看效果的
以上代码在IE5.5——8、FF3.0通过。其他没有测试