Skip to content

Instantly share code, notes, and snippets.

@gabelloyd
Last active August 29, 2015 13:58
Show Gist options
  • Select an option

  • Save gabelloyd/10305816 to your computer and use it in GitHub Desktop.

Select an option

Save gabelloyd/10305816 to your computer and use it in GitHub Desktop.
A Pen by Gabe Lloyd.
<h1>Masonry - stamp option</h1>
<div class="masonry js-masonry" data-masonry-options='{ "columnWidth": 60, "stamp": ".stamp" }'>
<div class="stamp stamp1">stamp wrapper
<div class="stamp stamp2">stamp 2</div>
<div class="stamp stamp2">stamp 2</div>
<div class="stamp stamp2">stamp 2</div>
</div>
<div class="item"></div>
<div class="item w2 h2"></div>
<div class="item h3"></div>
<div class="item h2"></div>
<div class="item w3"></div>
<div class="item"></div>
<div class="item"></div>
<div class="item h2"></div>
<div class="item w2 h3"></div>
<div class="item"></div>
<div class="item h2"></div>
<div class="item"></div>
<div class="item w2 h2"></div>
<div class="item w2"></div>
<div class="item"></div>
<div class="item h2"></div>
<div class="item"></div>
<div class="item"></div>
<div class="item h3"></div>
<div class="item h2"></div>
<div class="item"></div>
<div class="item"></div>
<div class="item h2"></div>
</div>
// http://masonry.desandro.com/masonry.pkgd.js added as external resource
* {
-webkit-box-sizing: border-box;
-moz-box-sizing: border-box;
box-sizing: border-box;
}
body { font-family: sans-serif; }
.masonry {
background: #EEE;
max-width: 640px;
position: relative;
}
.item {
width: 60px;
height: 60px;
float: left;
background: #D26;
border: 2px solid #333;
border-color: hsla(0, 0%, 0%, 0.5);
border-radius: 5px;
}
.item.w2 { width: 120px; }
.item.w3 { width: 180px; }
.item.w4 { width: 240px; }
.item.h2 { height: 100px; }
.item.h3 { height: 130px; }
.item.h4 { height: 180px; }
/* position stamp elements with CSS */
.stamp {
position: absolute;
background: blue;
border: 4px dotted black;
padding: 10px;
margin: .5em 0;
}
.stamp1 {
color: white;
right: 5%;
width: 30%;
height: 300px;
}
.stamp2 {
position: relative;
background: orange;
width: 100%;
height: 50px;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment