<div style=" float:left ; width:850px; " id="container"> <div style="float:right; width:400px; height:200px; background:#0C3">div2</div> <div style="width:400px; height:100px; background:#CCC">div1</div> <div style="width:400px; height:100px; background:#660">div3</div> </div>
你用下面布局就可以了。
<div style=" float:left ; width:850px; " id="container"> <div style="float:left;"> <div style="width:400px; height:100px; background:#CCC">div1</div> <div style="float:left; width:400px; height:100px; background:#660">div3</div> </div> <div style="float:left; width:400px; height:200px; background:#0C3">div2</div> </div>
先谢谢各位的回答, 可能我的问题没表述清楚 , 我现在是从后台返回一个集合在 前台循环出来, 可能有10来个Div , 每个Div的高度都是自适应 , 我并不知道得把哪个 设成 float:left 或 float:right , 用绝对定位的话, 高度也不好确定
先谢谢各位的回答, 可能我的问题没表述清楚 , 我现在是从后台返回一个集合在 前台循环出来, 可能有10来个Div , 每个Div的高度都是自适应 , 我并不知道得把哪个 设成 float:left 或 float:right , 用绝对定位的话, 高度也不好确定
用 瀑布流masonry这个插件,自动帮你计算位置高度,放到合适的位置
楼上正解,用瀑布流处理吧
先谢谢各位的回答, 可能我的问题没表述清楚 , 我现在是从后台返回一个集合在 前台循环出来, 可能有10来个Div , 每个Div的高度都是自适应 , 我并不知道得把哪个 设成 float:left 或 float:right , 用绝对定位的话, 高度也不好确定
用 瀑布流masonry这个插件,自动帮你计算位置高度,放到合适的位置
谢谢!
HTML怎么学习?HTML怎么入门?HTML在哪学?HTML怎么学才快?不用担心,这里为大家提供了HTML速学教程(入门课程),有需要的小伙伴保存下载就能学习啦!
Copyright 2014-2025 https://www.php.cn/ All Rights Reserved | php.cn | 湘ICP备2023035733号