I have a dilemma with my large div that contains multiple thumbnails. I am looking to center the thumbnails within the div and have the overall div centered on the page. Additionally, I want the width of the div to be flexible so that all thumbnails can be seen on any screen resolution while also maintaining a centered position. How should I go about achieving this?
Here is what I have attempted so far:
<div id="container">
<div class="thumb"><img /></div>
<div class="thumb"><img /></div>
<div class="thumb"><img /></div>
<div class="thumb"><img /></div>
<div class="thumb"><img /></div>
<div class="thumb"><img /></div>
</div>
I have tried using the following CSS code for centering: The challenge lies in finding an alternative to float: left that would allow for central positioning and prevent the thumbnails from floating off-center when adjusting the browser window size.
#container{margin:auto;width:80%}
.thumb{padding:60px;float:left}
Is there a way to achieve something similar to float:center?