Created
February 23, 2015 00:50
-
-
Save pgarciacamou/b81e7ac0e59977ac9ad1 to your computer and use it in GitHub Desktop.
This piece of code will use the CSS3 column-count property to display images in a -Pinterest-esque way.
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
<!DOCTYPE html> | |
<html> | |
<head> | |
<style> | |
.images { | |
-webkit-column-count: 3; /* Chrome, Safari, Opera */ | |
-moz-column-count: 3; /* Firefox */ | |
column-count: 3; | |
} | |
.images img { width: 100%; } | |
</style> | |
</head> | |
<body> | |
<p>Internet Explorer 9, and earlier versions, does not support the column-count property.</p> | |
<div class="images"> | |
<img src="http://dummyimage.com/600x400/000/fff"> | |
<img src="http://dummyimage.com/600x500/000/fff"> | |
<img src="http://dummyimage.com/600x300/000/fff"> | |
<img src="http://dummyimage.com/600x400/000/fff"> | |
<img src="http://dummyimage.com/600x500/000/fff"> | |
<img src="http://dummyimage.com/600x300/000/fff"> | |
<img src="http://dummyimage.com/600x400/000/fff"> | |
<img src="http://dummyimage.com/600x500/000/fff"> | |
<img src="http://dummyimage.com/600x300/000/fff"> | |
<img src="http://dummyimage.com/600x400/000/fff"> | |
<img src="http://dummyimage.com/600x500/000/fff"> | |
<img src="http://dummyimage.com/600x300/000/fff"> | |
<img src="http://dummyimage.com/600x400/000/fff"> | |
<img src="http://dummyimage.com/600x500/000/fff"> | |
<img src="http://dummyimage.com/600x300/000/fff"> | |
</div> | |
</body> | |
</html> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment