如果您将使用媒体查询,这可能会有所帮助,希望:
HTML:
<ul>
<li class="image"></li>
<li class="image"></li>
<li class="image2"></li>
<li class="image"></li>
<li class="image"></li>
<li class="image fix1" ></li>
<li class="image2"></li>
<li class="image"></li>
<li class="image"></li>
<li class="image"></li>
<li class="image"></li>
<li class="image"></li>
<li class="image"></li>
<li class="image fix2"></li>
</ul>
CSS:
ul {
width:1200px;
padding:10px;
}
li.image {
float: left;
margin: 10px;
overflow: hidden;
width:220px;
height:220px;
background-color:black;
}
li.image2 {
float: left;
margin: 10px;
overflow: hidden;
width:460px;
height:460px;
background-color:black;
}
li.fix1 {
margin-top:-230px;
}
li.fix2 {
margin-top:-710px;
margin-left:250px;
}
演示:
http: //fiddle.jshell.net/upwxrga3/show/
编辑:更新了 CSS,因为 HTML 无法更改:
ul {
width:1200px;
padding:10px;
}
li.image {
float: left;
margin: 10px;
overflow: hidden;
width:220px;
height:220px;
background-color:black;
}
ul li:nth-child(3), ul li:nth-child(7) {
float: left;
margin: 10px;
overflow: hidden;
width:460px;
height:460px;
background-color:black;
}
ul li:nth-child(6) {
margin-top:-230px;
}
ul li:nth-child(14) {
margin-top:-710px;
margin-left:250px;
}