對不起,如果這是一個轉發,但這是我一直在這裏研究了一段時間,我似乎無法拿出正確的答案。我試圖讓這些圖像出現在頁面正中的下方的字幕中,但它們繼續在頁面的左側。以字幕爲中心
這裏是我的html
<figure>
<img src="apple.jpg" alt='apple/>
<figcaption>Apple</figcaption>
</figure>
<figure>
<img src="apple.jpg" alt='apple'/>
<figcaption>Apple</figcaption>
</figure>
<figure>
<img src="apple.jpg" alt='apple'/>
<figcaption>Apple</figcaption>
</figure>
而CSS
figure{
display: inline-block;
margin: 0 auto;
}
figure img{
vertical-align: top;
}
figure figcaption{
text-align: center;
}
這是我看到:提前
感謝。我非常感謝任何幫助。
,嘗試添加顯示:塊;並將左右邊距設置爲自動。 https://jsfiddle.net/bvabamyy/ –
我試過了,沒有任何變化 –
你想在中心或3行並排3個imgs?只有水平中心或垂直中心? –