我想在Tumblr上自定義我的博客,但我遇到了一些麻煩。我想要的是在我的博客中水平居中的圖片,其中包含下一個和上一個按鈕。它應該看起來像按鈕之間的中心圖像
-O [__] O
,其中O是我的按鈕和[_]代表我的照片。 如何將三個元素集中在我的頁面上,並將按鈕與圖片相距一定數量的像素?每個按鈕都有自己的DIV,照片有一個類,並且有一個DIV包含其中的三個。
我的HTML是這樣的:
<div class="photo-wrap">
<div id="previous">
<img src="http://static.tumblr.com/gptupvc/hUhlxhrgd/next.png"></img>
</div>
{block:Posts}
{block:Photo}
<center>
<a href="{Permalink}"><img class="photo" src="{PhotoURL-HighRes}"></img></a></center>
{/block:Photo}
{/block:Posts}
</div>
<div id="next">
<img src="http://static.tumblr.com/gptupvc/hUhlxhrgd/next.png"></img>
</div>
與下面的CSS
.photo-wrap {
position:relative;
margin-top:50px;
width:1200px;
margin-left:auto;
margin-right:auto;
background-color:red;
}
.photo {
float:left;
height:600px;
border-radius:10px;
}
#next {
float:right;
margin-top:-350px;
background-color:green;
}
#next img {
width:100px;
height:100px;
}
#previous {
float:left;
margin-top:250px;
background-color:red;
}
#previous img {
width:100px;
height:100px;
}