请问如何实现这种浮动。谢谢_html/css_WEB-ITnose

WBOY
Release: 2016-06-21 09:31:59
Original
966 people have browsed it

<!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>
Copy after login



让div浮动后紧跟上面的div对接。而不是出现新的一行。


回复讨论(解决方案)

这个没有好办法,我是通过定位来实现的。

楼主是想五个div都浮动在同一列吗?

source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template