I am seeking to implement floating boxes (divs with thumbnails) where the number of thumbnails adjusts based on the current page width. For instance:
<div class="container">
<div class="box1" style="float:left;width:120px;height:120px;margin-right:10px;">Thumbnail image here</div>
<div class="box2" style="float:left;width:120px;height:120px;margin-right:10px;">Thumbnail image here</div>
<div class="box3" style="float:left;width:120px;height:120px;margin-right:10px;">Thumbnail image here</div>
<div class="box4" style="float:left;width:120px;height:120px;margin-right:10px;">Thumbnail image here</div>
.......... ETC
</div>
The issue arises when, at a given width, the boxes are displayed with some white space on the right side due to left alignment. How can I center each row horizontally on the page?
I am looking for a layout similar to this example: , but with horizontally centered boxes.
Thank you in advance,