I just want to center the images(item) in the middle of the masonry grid (My Website). The problem is that the images are always agline to the left. So I always get a gap on the right in the masonry grid.
Sorry for this bad question composing but it's my first question here and I'm struggling with this problem now for 3 days.
This is my code for the gallary.
var container = document.querySelector('#masonry');
var msnry = new Masonry( container, {
columnWidth: 50,
itemSelector: '.item'
});
The gallery code looks like this.
<div id='masonry'>
<img class="item thumbnail" src="...">
<img class="item thumbnail" src="...">
<img class="item thumbnail" src="...">
<div>
Here is the CSS.
/* MASONRY GALLARY */
* {
-webkit-box-sizing: border-box;
-moz-box-sizing: border-box;
box-sizing: border-box;
}
.thumbnail {
width: 100%;
padding: 0 0;
margin: 0 0.1px;
display: block;
border: hidden;
border-color: transparent;
}
.item {
min-width: 10px;
max-width: 600px;
min-height: 50px;
padding: 0 0;
margin: 0 0;
border: 0;
border-color: transparent;
}
#masonry {
margin: 0 auto;
}