我有一个HTML,显示一些带有背景图片的窗口。每行包含一些这样的窗口。现在,我想要一个小的变化,我想将第一行第二窗口(以及该行中的所有窗口)定位到第二行中第二个窗口的右侧。简而言之,窗口应该只是移动到第二行中第二个窗口的右侧。我不知道该怎么做。这是用HTML和HTML编写的代码。 CSS为
HTML代码 -
<div class="container">
<div class="flower chunk1">
<div><img src="http://assets.freeprintable.com/images/item/thumb/lotus-flower.jpg"/></div></div>
<div class="flower chunk15">
<div><img src="http://assets.freeprintable.com/images/item/thumb/lotus-flower.jpg"/></div></div>
<div class="flower chunk2">
<div><img src="http://assets.freeprintable.com/images/item/thumb/lotus-flower.jpg"/></div></div>
<div class="flower chunk3">
<div><img src="http://assets.freeprintable.com/images/item/thumb/lotus-flower.jpg"/></div></div>
<div class="flower chunk4">
<div><img src="http://assets.freeprintable.com/images/item/thumb/lotus-flower.jpg"/></div></div>
</div>
<div class="container">
<div class="flower chunk5">
<div><img src="http://assets.freeprintable.com/images/item/thumb/lotus-flower.jpg"/></div></div>
<div class="flower chunk6">
<div><img src="http://assets.freeprintable.com/images/item/thumb/lotus-flower.jpg"/></div></div>
<div class="flower chunk7">
<div><img src="http://assets.freeprintable.com/images/item/thumb/lotus-flower.jpg"/></div></div>
<div class="flower chunk8">
<div><img src="http://assets.freeprintable.com/images/item/thumb/lotus-flower.jpg"/></div></div>
</div>
<div class="container">
<div class="flower chunk9">
<div><img src="http://assets.freeprintable.com/images/item/thumb/lotus-flower.jpg"/></div></div>
<div class="flower chunk10">
<div><img src="http://assets.freeprintable.com/images/item/thumb/lotus-flower.jpg"/></div></div>
<div class="flower chunk11">
<div><img src="http://assets.freeprintable.com/images/item/thumb/lotus-flower.jpg"/></div></div>
<div class="flower chunk12">
<div><img src="http://assets.freeprintable.com/images/item/thumb/lotus-flower.jpg"/></div></div>
</div>
CSS代码 -
.container {
float: left;
white-space: nowrap;
}
.flower {
display: inline;
float: left;
margin: 10px;
width: 100px;
height: 100px;
overflow: hidden;
border: 1px solid red;
}
.flower img {
width: 100%;
height: 100%;
}
.flower div {
width: 200px;
height: 200px;
position: relative;
}
.chunk2 div {
left: -100px;
}
.chunk3 div {
top: -100px;
}
.chunk4 div {
top: -100px;
left: -100px;
}
这是jsFiddle链接http://jsfiddle.net/VSd6Y/16/ 请让我知道如何在同一行中移动窗口。
谢谢!