What is Masonry?
Masonry is a JavaScript grid layout library. It works by placing elements in optimal position based on available vertical space.
Using Masonry is easy—just follow these simple steps:
HTML
<script src="https://cdnjs.cloudflare.com/ajax/libs/masonry/3.3.0/masonry.pkgd.js"></script>
CSS
Masonry works on a container grid element with a group of child items.
.grid-item { width: 200px; }
.grid-item--width2 { width: 400px; }
jQuery
$('.grid').masonry({
// options
itemSelector: '.grid-item',
columnWidth: 200
});
Example :
Thanks
More From Oodles
Ready to innovate? Let's get in touch
Cookies are important to the proper functioning of a site. To improve your experience, we use cookies to remember log-in details and provide secure log-in, collect statistics to optimize site functionality, and deliver content tailored to your interests. Click Agree and Proceed to accept cookies and go directly to the site or click on View Cookie Settings to see detailed descriptions of the types of cookies and choose whether to accept certain cookies while on the site.
About Author
Darshan Dang
Darshan is a creative UI designer with experience and capabilities to build compelling UI designs for Web and Mobile Applications. Darshan likes Punjabi songs and Travelling in Free Time .