Rumah > Artikel > hujung hadapan web > 请问如何实现这种浮动。谢谢_html/css_WEB-ITnose
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><html xmlns="http://www.w3.org/1999/xhtml"><head><meta http-equiv="Content-Type" content="text/html; charset=gb2312" /><meta http-equiv="X-UA-Compatible" content="IE=EmulateIE7" /><title></title><style type="text/css">body{margin:0px;padding:0px;font-size:12px;padding:40px 0px 0px 40px;}div{margin:0px;padding:0px;}#box{width:900px;background:#F69;}#box div{float:left;}</style></head><body><div id="box"> <div style="height:160px;background:blue;width:300px;">1</div> <div style="height:260px;background:yellow;width:300px;">2</div> <div style="height:180px;background:red;width:300px;">3</div> <div style="height:160px;background:blue;width:300px;">1</div> <div style="height:120px;background:green;width:300px;">1</div></div></body></html>
这个没有好办法,我是通过定位来实现的。
楼主是想五个div都浮动在同一列吗?