1
我有一個包含三個圖像的div,我想將它居中放置在頁面的中心(很像Google搜索欄)。我嘗試過幾乎所有的東西(位置,邊距等),但是即使我把它放在一臺顯示器上,當我將它移動到不同的顯示器時,它也不會集中在新顯示器上。請幫忙!居中包含圖像的DIV,無論窗口大小如何
下面是HTML:
<div id="boxes">
<a href="voting_registration.html" target="_blank"> <img src="images/VR.jpg" alt="Voting Registration Information" class="list" /></a>
<a href="ballot.html" target="_blank"> <img src="images/PCB.jpg" alt="Platforms, Candidates and Ballots" class="list" /></a>
<a href="voting_information.html" target="_blank"><img src="images/VI.jpg" alt="Voting Information" class="list"/> </a>
</div>
[Flexbox:水平和垂直居中]的可能重複(http://stackoverflow.com/questions/19026884/flexbox-center-horizontally-and-vertically) –
[居中響應div與圖像內部]的可能重複( http://stackoverflow.com/questions/34408145/centering-responsive-divs-with-images-inside)以及通過搜索搜索到的其他衆多答案。 – Rob