Created
April 7, 2023 19:50
-
-
Save realityexpander/8baa58a8d9b1aab3318e5606af5cb322 to your computer and use it in GitHub Desktop.
Improve example of Masonry grid.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<style> | |
/* CSS Grid Layout */ | |
.grid-container { | |
width: 600px; | |
-webkit-column-count: 3; | |
-moz-column-count: 3; | |
column-count: 3; | |
-webkit-column-gap: 15px; | |
-moz-column-gap: 15px; | |
column-gap: 15px; | |
} | |
.grid-item { | |
display: block; | |
/* match gap size */ | |
margin-bottom: 15px; | |
} | |
</style> | |
<!-- This is the CSS Grid layout --> | |
<class="grid-container"> | |
<div class="grid-item"> | |
<img src="https://picsum.photos/200/300" alt="image"> | |
</div> | |
<div class="grid-item"> | |
<img src="https://picsum.photos/200/400" alt="image"> | |
</div> | |
<div class="grid-item"> | |
<img src="https://picsum.photos/200/500" alt="image"> | |
</div> | |
<div class="grid-item"> | |
<img src="https://picsum.photos/200/300" alt="image"> | |
</div> | |
<div class="grid-item"> | |
<img src="https://picsum.photos/200/600" alt="image"> | |
</div> | |
</div> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment