First of all, you can't have multiple elements with the same ID. You have multiple elements with an ID of thumb
. You can't do that. Use classes instead.
Then set the display
of the thumbnails to inline-block
and text-align
of the container to center
:
#container {
text-align: center;
}
.thumb {
display: inline-block;
}
A few other things wrong in your code:
display: box
is very unlikely what you want. You probably wantblock
instead.left
andtop
have no effect whatsoever unlessposition
is set.- You seem to have a strange attraction to
float: left
where it is unnecessary. - I needed to change a
margin
to apadding
to keep the same spacing.