Grid 实现瀑布流布局

时间:2022-12-20 20:06:48
 <!doctype html>
<html> <head>
<meta charset="utf-8">
</head>
<style type="text/css">
#content {
width: 400px;
}
#content,
#content>.panel,
#content .column,
#content .column>li {
margin: 0px;
padding: 0px;
}
#content>.panel {
width: 100%;
background: #eee;
overflow-y: hidden;
padding-left: 5px;
padding-right: 5px;
}
#content .column {
width:190px;
float: left;
margin-left: 5px;
margin-right: 5px; }
#content .column>li {
width: 100%;
list-style-type: none;
border-radius: 5px;
background: #fff;
margin-bottom: 10px;
margin-top: 10px;
overflow: hidden;
text-align: center;
}
#content .column img {
border: none;
vertical-align: middle;
}
</style> <body>
<div id="content">
<div class="panel">
<ul class="left column">
<li><img src="timg.jpg" width="100%" height="65px"></li>
<li><img src="timg.jpg" width="100%" height="250px"></li>
<li><img src="timg.jpg" width="100%" height="250px"></li>
<li><img src="timg.jpg" width="100%" height="250px"></li>
<li><img src="timg.jpg" width="100%" height="250px"></li>
<li><img src="timg.jpg" width="100%" height="250px"></li>
</ul>
59
60
<ul class="right column">
<li><img src="timg.jpg" width="100%" height="200px"></li>
<li><img src="timg.jpg" width="100%" height="250px"></li>
<li><img src="timg.jpg" width="100%" height="250px"></li>
<li><img src="timg.jpg" width="100%" height="250px"></li>
<li><img src="timg.jpg" width="100%" height="250px"></li>
</ul>
</div>
</div> </body> </html>