I wrote this thumbnails gallery using jquery lightbox plugin years ago.
<div class="p">
<ul class="gallery">
<li><a rel="lightbox-gallery" href="..."><img src="..."></a></li>
<li>...</li>
</ul>
</div>
div.p {
text-align: justify;
}
.gallery li {
display: inline;
list-style-type: none;
}
Maybe it’s not perfect but it spaces evenly on the whole column width and self adapts itself on window resize.
Now pics are nearly 40 and I’d like to add with jquery a little overlay with photo number, something like this:

but I’m having some trouble since elements are inline and not block.
Is it possible to achieve it without changing base style?
position: absolute;will do the trick. The<li>needs to beposition: relative.Demo: http://jsfiddle.net/ThinkingStiff/gH7vH/
HTML:
CSS: