1

I have a div that contains three images and I want to center it in the center of the page (much like the Google search bar). I've tried playing around with just about everything (position, margin, etc.) but even if I get it centered on one monitor, when I move it to a different monitor it is not centered on that new monitor. Please help!

Here is the 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>
Michael Benjamin
  • 346,931
  • 104
  • 581
  • 701
Nora
  • 11
  • 1
  • Possible duplicate of [Flexbox: center horizontally and vertically](http://stackoverflow.com/questions/19026884/flexbox-center-horizontally-and-vertically) – Michael Benjamin Apr 11 '17 at 16:01
  • Possible duplicate of [centering responsive divs with images inside](http://stackoverflow.com/questions/34408145/centering-responsive-divs-with-images-inside) and a multitude of other answers found by searching SO. – Rob Apr 11 '17 at 16:37

1 Answers1

-1

use this to your boxes's css code :

margin: 0 auto;

0 is margin-top, means 0 pixels from top and you can change that.

CleverBoY
  • 1
  • 1
  • I would edit this answer but the edit queue is full. Would you consider improving the quality of this answer with correct grammar and formatting? A live demo showing how this works would also be very helpful. – Zac Apr 11 '17 at 17:14