I am trying to position thumbnails across the screen with even "padding". Here is an image illustrating the problem:
<!DOCTYPE html>
<html>
<head>
<title>Test rows</title>
<style type="text/css">
body {
background: #121212;
color: #fff;
}
#Container {
background: #585858;
margin: 0 auto;
min-width: 1024px;
width: 85%;
margin-top: 50px;
text-align: justify;
-ms-text-justify: distribute-all-lines;
text-justify: distribute-all-lines;
}
#Container a {
vertical-align: top;
display: inline-block;
*display: inline;
zoom: 1;
}
.stretch {
width: 100%;
display: inline-block;
font-size: 0;
line-height: 0;
}
</style>
</head>
<body>
<div id="Container">
<a href="#"><img src="http://dummyimage.com/200x120/444/fff" /></a>
<a href="#"><img src="http://dummyimage.com/200x120/444/fff" /></a>
<a href="#"><img src="http://dummyimage.com/200x120/444/fff" /></a>
<a href="#"><img src="http://dummyimage.com/200x120/444/fff" /></a>
<a href="#"><img src="http://dummyimage.com/200x120/444/fff" /></a>
<a href="#"><img src="http://dummyimage.com/200x120/444/fff" /></a>
<a href="#"><img src="http://dummyimage.com/200x120/444/fff" /></a>
<a href="#"><img src="http://dummyimage.com/200x120/444/fff" /></a>
<a href="#"><img src="http://dummyimage.com/200x120/444/fff" /></a>
<a href="#"><img src="http://dummyimage.com/200x120/444/fff" /></a>
<a href="#"><img src="http://dummyimage.com/200x120/444/fff" /></a>
<a href="#"><img src="http://dummyimage.com/200x120/444/fff" /></a>
<span class="stretch"></span>
</div>
</body>
</html>
I did some research here in stackoverflow and found some usefull code to start, but I am facing a few problems. I want the images to align from left to right and not "snap" to the boders of the container when I have less images in the last rows as you see the image.
Also I would like to have the "vertical space" between rows to be equal to the horizontal spacing between images, for now I have some vertical spacing like "3px" and I am not sure where is comming from. I am opened to js solutions if needed. Thank you