我有三個<figure>
標籤,我想在我的container
div中水平對齊它們。我嘗試了float左,右和邊距自動方法,但沒有奏效。我該怎麼辦?如何在div中水平對齊列
* {
margin: 0;
padding: 0;
}
.container {
width: 100%;
}
.col {
width: 33.33%;
float: left;
}
<div class="container">
<figure class="col">
<img src="http://placehold.it/300x300">
</figure>
<figure class="col">
<img src="http://placehold.it/300x300">
</figure>
<figure class="col">
<img src="http://placehold.it/300x300">
</figure>
</div>
似乎沒什麼問題,或者你想他們在一起? – jaunt
@jaunt +1。 GSG,你到底想要什麼?你面臨什麼問題? –
@GSG我已經發布了答案,我認爲它可以幫助你。 – divy3993