
有两个div,怎么让下面一个div随着上面div的内容增多而往下拉,上面div的内容减少,下面的div自动填充上去
2个回答
展开全部
设定这两个层分别为x1和x2,宽度都为950像素,x1和x2的高度随各自的内容自动变化,x2可以自动适应x1。
<style type="text/css">
.x1{width:950px;height:auto;float:left;clear:both;}
.x2{width:950px;height:auto;float:left;clear:both;}
</style>
<div class="x1"></div>
<div class="x2"></div>
<style type="text/css">
.x1{width:950px;height:auto;float:left;clear:both;}
.x2{width:950px;height:auto;float:left;clear:both;}
</style>
<div class="x1"></div>
<div class="x2"></div>
本回答被提问者采纳
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询