Skip to content

Instantly share code, notes, and snippets.

@xto3na
Last active October 11, 2018 14:30
Show Gist options
  • Save xto3na/9bb2e2a688ea56bc4023911b08a76639 to your computer and use it in GitHub Desktop.
Save xto3na/9bb2e2a688ea56bc4023911b08a76639 to your computer and use it in GitHub Desktop.
Masonry grid CSS
<style>
.masonry-layout {
column-count: 3;
-webkit-column-count: 3;
column-gap: 0;
-webkit-column-gap: 0;
}
.masonry-layout_item {
break-inside: avoid;
-webkit-column-break-inside: avoid;
padding: 5px;
}
</style>
<div class="masonry-layout">
<div class="masonry-layout_item"></div>
<div class="masonry-layout_item"></div>
<div class="masonry-layout_item"></div>
<div class="masonry-layout_item"></div>
<div class="masonry-layout_item"></div>
<div class="masonry-layout_item"></div>
<div class="masonry-layout_item"></div>
<div class="masonry-layout_item"></div>
<div class="masonry-layout_item"></div>
</div>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment