please help solve the problem. for dense packing blocks I used a popular plugin masonry.
my resulting code is not worked. but I used the method described in the documentation
$('#container').masonry({
itemSelector: '.box',
// set columnWidth a fraction of the container width
columnWidth: function( containerWidth ) {
return containerWidth / 5;
}
});
css:
#container{
max-width: 1000px;
margin: 0 auto;
overflow: hidden;
}
#container .item{
width: 33.3%;
background: red;
float: left;
}