Paulo, I have 2 solutions for you:
1st Center the items:
First we will use li for each item in the example, it is more semantic and also makes it easier because we will have to add the attr text-align center to ul.
Ex:
ul {
display: block;
text-align: center;
}
li {
background-color: rgb(201, 225, 222);
display: inline-block;
height: 180px;
width: 120px;
}
<ul>
<li>item 1</li>
<li>item 2</li>
<li>item 3</li>
<li>item 4</li>
</ul>
Explanation: this makes the elements only align to the middle.
2º Centering and generating space between items:
For this example I will increment the example above..
You have used li to delimit the number of items per line and centralize Thumb within that container.
Ex.:
/*resets*/
* {
box-sizing: border-box;
margin: 0;
padding: 0;
}
ul {
display: block;
position: relative;
text-align: center;
width: 100%;
}
li {
background-color: white;
display: inline-block;
min-width: 24.5%;
}
img {
background-color: rgb(201, 225, 222);
height: 180px;
margin: 10px auto;
width: 120px;
}
<ul>
<li>
<img src="#" alt="item 1">
</li>
<li>
<img src="#" alt="item 2">
</li>
<li>
<img src="#" alt="item 3">
</li>
<li>
<img src="#" alt="item 4">
</li>
</ul>
Explanation:
- I determined that it would be 4 items per column because each li has 24.5 min-width%.
Note: if you delimit the li with 25% you will see that one of the elements must break below, this is due to the rendering of the browser, because it considers in addition to the 25% of the elements some other elements such as the scroll bar that add up to more than 100% and this generates the break, that is, I advise you to use a little below this value, as for example 24.5%.
Aligns Thumb inside the li with margin 0 auto;
For other breaks in the responsive you can use media query, for example for 2 items per column you use 50% min-width (use 49%).
Examples of Media query.
There are also other solutions like flexbox, display table...
But I advise you to use these, because they are the easiest and compatible with the browsers used today.
I hope to have helped, any doubts can comment.. Thanks!