<div class="bg--blue">
 <a target="_blank" href="http://musictrot.com"><img style="position: absolute; top: 0; right: 0; border: 0; z-index: 9999;" src="https://tistory1.daumcdn.net/tistory/240726/skin/images/flexbox.png" alt="Fork me on GitHub" data-canonical-src="https://s3.amazonaws.com/github/ribbons/forkme_right_darkblue_121621.png"></a>
 <div class="dw">
 <div class="dw-pnl dw-pnl--fcs">
 <div class="dw-pnl__cntnt bd--white tx--white">
 <h1>Pure CSS masonry layout</h1>
 </div>
 </div>
 <div class="dw-pnl">
 <div class="dw-pnl__cntnt bd--white tx--white">
 <ul>
 <li>Configurable</li>
 <li>Responsive</li>
 <li>Supports clusters</li>
 </ul>
 </div>
 </div>
 <div class="dw-pnl "><img src="https://unsplash.it/419/?random" class="dw-pnl__cntnt"/>
 </div>
 <div class="dw-pnl ">
 <div class="dw-pnl__cntnt tx--white bd--white">
 <p>Phasellus malesuada, urna non auctor viverra, libero ex pellentesque urna, id rhoncus eros lacus tristique risus. Interdum et malesuada fames ac ante ipsum primis in faucibus.</p>
 </div>
 </div>
 <div class="dw-pnl ">
 <img src="https://unsplash.it/445/?random" class="dw-pnl__cntnt"/>
 </div>
 <div class="dw-pnl ">
 <img src="https://unsplash.it/423/?random" class="dw-pnl__cntnt"/>
 </div>
 <div class="dw-pnl dw-clstr dw-clstr--hrz">
 <div class="dw-clstr__sgmnt dw-clstr__sgmnt--rw ">
 <div class="dw-pnl dw-clstr__sgmnt ">
 <div class="dw-pnl__cntnt bd--white tx--white">
 <h2>How</h2>
 </div>
 </div>
 </div>
 <div class="dw-clstr__sgmnt dw-clstr__sgmnt--rw ">
 <div class="dw-pnl dw-clstr__sgmnt ">
 <div class="dw-pnl__cntnt bd--white tx--white">
 <h2>about</h2>
 </div>
 </div>
 <div class="dw-pnl dw-clstr__sgmnt ">
 <div class="dw-pnl__cntnt bd--white tx--white">
 <h2>clusters?</h2>
 </div>
 </div>
 </div>
 </div>
 <div class="dw-pnl ">
 <img src="https://unsplash.it/420/?random" class="dw-pnl__cntnt"/>
 </div>
 <div style="height: 200px;" class="dw-pnl dw-flp">
 <div class="dw-pnl__cntnt dw-flp__cntnt">
 <div class="dw-flp__pnl dw-flp__pnl--frnt tx--white bd--white tx--center">
 <h1>You can flip me round</h1>
 </div>
 <div class="dw-flp__pnl dw-flp__pnl--bck bd--white tx--white tx--center">
 <h1>Yeah that's right</h1>
 </div>
 </div>
 </div>
 <div class="dw-pnl dw-clstr dw-clstr--vrt">
 <div class="dw-clstr__sgmnt dw-clstr__sgmnt--clmn ">
 <div class="dw-pnl dw-clstr__sgmnt ">
 <div class="dw-pnl__cntnt bd--white tx--white">
 <h2>A</h2>
 </div>
 </div>
 </div>
 <div class="dw-clstr__sgmnt dw-clstr__sgmnt--clmn ">
 <div class="dw-pnl dw-clstr__sgmnt ">
 <div class="dw-pnl__cntnt bd--white tx--white">
 <h2>vertically</h2>
 </div>
 </div>
 <div class="dw-pnl dw-clstr__sgmnt ">
 <div class="dw-pnl__cntnt bd--white tx--white">
 <h2>flowed</h2>
 </div>
 </div>
 <div class="dw-pnl dw-clstr__sgmnt ">
 <div class="dw-pnl__cntnt bd--white tx--white">
 <h2>cluster</h2>
 </div>
 </div>
 </div>
 </div>
 <div class="dw-pnl "><img src="https://unsplash.it/424/?random" class="dw-pnl__cntnt"/>
 </div>
 <div class="dw-pnl ">
 <div class="dw-pnl__cntnt bd--white bg--darkred tx--white">
 <p>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Duis eu justo ex. Praesent mollis augue sagittis eros pharetra feugiat. Phasellus dignissim est lacus. Sed nec imperdiet dolor, sit amet mattis ex. Sed sed augue eu neque tristique commodo. Mauris aliquet tortor sollicitudin nibh molestie, id egestas nisl sollicitudin. Aliquam erat volutpat. Donec quis ultrices ligula. Cras sed purus risus. Curabitur quis eros eu tortor semper eleifend. Pellentesque lorem elit, dignissim interdum massa id, malesuada rutrum ligula. Suspendisse tempor quis mauris eu facilisis. Phasellus non volutpat diam, non dapibus ligula. Ut non molestie ex, nec sagittis mi. Curabitur suscipit tellus id dolor pretium blandit. Cras tristique tristique pharetra.</p>
 </div>
 </div>
 <div class="dw-pnl "><img src="https://unsplash.it/425/?random" class="dw-pnl__cntnt"/>
 </div>
 <div class="dw-pnl dw-pnl--fcs">
 <div class="dw-pnl__cntnt tx--white bd--white tx--center">
 <h1>Focus on hover</h1>
 </div>
 </div>
 <div class="dw-pnl ">
 <div class="dw-pnl__cntnt tx--white bd--white">
 <h2>Title for some content</h2>
 <p>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Duis eu justo ex. Praesent mollis augue sagittis eros pharetra feugiat. Phasellus dignissim est lacus. Sed nec imperdiet dolor, sit amet mattis ex. Sed sed augue eu neque tristique commodo. Mauris aliquet tortor sollicitudin nibh molestie, id egestas nisl sollicitudin. Aliquam erat volutpat. Donec quis ultrices ligula. Cras sed purus risus. Curabitur quis eros eu tortor semper eleifend.</p>
 </div>
 </div>
 <div class="dw-pnl dw-pnl--pls">
 <div class="dw-pnl__cntnt tx--white bd--white bg--darkred tx--center">
 <h1>Pulse on hover</h1>
 </div>
 </div>
 <div class="dw-pnl "><img src="https://unsplash.it/440/?random" class="dw-pnl__cntnt"/>
 </div>
 <div class="dw__fcs-crtn"></div>
 </div>
</div>
.dw {
 -webkit-animation: fade 2s;
 animation: fade 2s;
}
.dw {
 box-sizing: border-box;
 -moz-column-gap: 0;
 column-gap: 0;
 position: relative;
}
.dw * {
 box-sizing: border-box;
}
.dw__fcs-crtn {
 background-color: #000;
 bottom: 0;
 display: none;
 left: 0;
 opacity: 0.75;
 position: fixed;
 right: 0;
 top: 0;
 z-index: 2;
}
@media (min-width: 768px) {
 .dw {
 -moz-column-count: 2;
 column-count: 2;
 }
}
@media (min-width: 992px) {
 .dw {
 -moz-column-count: 3;
 column-count: 3;
 }
}
@media (min-width: 1500px) {
 .dw {
 -moz-column-count: 4;
 column-count: 4;
 }
}
.dw-pnl {
 margin: 0;
 padding: 5px;
}
.dw-pnl--fcs {
 position: relative;
}
.dw-pnl--fcs:hover {
 z-index: 3;
}
.dw-pnl--fcs:hover ~ .dw__fcs-crtn {
 display: block;
}
.dw-pnl--pls {
 transform-style: preserve-3d;
 perspective: 1000;
 transition: transform 0.25s ease 0s;
}
.dw-pnl--pls:hover {
 transform: scale(1.02);
}
.dw-pnl__cntnt {
 border-radius: 10px;
 overflow: hidden;
 padding: 20px;
 width: 100%;
}
@media (min-width: 768px) {
 .dw-pnl {
 -moz-column-break-inside: avoid;
 break-inside: avoid;
 }
}
.dw-flp {
 perspective: 1000;
}
.dw-flp:hover .dw-flp__cntnt {
 transform: rotateY(180deg);
}
.dw-flp--sm {
 height: 200px;
}
.dw-flp--md {
 height: 300px;
}
.dw-flp--lg {
 height: 400px;
}
.dw-flp__pnl {
 -webkit-backface-visibility: hidden;
 backface-visibility: hidden;
 border-radius: 10px;
 height: 100%;
 left: 0;
 overflow: visible;
 padding: 20px;
 position: absolute;
 top: 0;
 width: 100%;
}
.dw-flp__pnl--frnt {
 transform: rotateY(0deg);
 z-index: 2;
}
.dw-flp__pnl--bck {
 transform: rotateY(180deg);
}
.dw-flp__cntnt {
 height: 100%;
 overflow: visible;
 position: relative;
 transform-style: preserve-3d;
 transition: 0.25s;
}
.dw-clstr {
 display: flex;
 padding: 0;
}
@media (max-width: 430px) {
 .dw-clstr--vrt {
 flex-direction: column;
 }
}
.dw-clstr--hrz {
 flex-direction: column;
}
.dw-clstr__sgmnt {
 display: flex;
 flex: 1 1 auto;
}
.dw-clstr__sgmnt--rw {
 display: flex;
}
@media (max-width: 430px) {
 .dw-clstr__sgmnt--rw {
 flex-direction: column;
 }
}
.dw-clstr__sgmnt--clmn {
 flex-direction: column;
}
@media (min-width: 430px) {
 .dw-clstr__sgmnt--hlf {
 flex-basis: 50%;
 }
 .dw-clstr__sgmnt--qrt {
 flex-basis: 25%;
 }
}
/**
 * Theming
*/
* {
 box-sizing: border-box;
}
.tx--left {
 text-align: left;
}
.tx--right {
 text-align: right;
}
.tx--center {
 text-align: center;
}
body {
 font-family: 'Open Sans', sans-serif;
}
h3 {
 margin-top: 0;
}
/**
* Colors
*/
.bd--black {
 border: 4px solid #000;
}
.bg--black {
 background-color: #000;
}
.tx--black {
 color: #000;
}
.bd--red {
 border: 4px solid #e74c3c;
}
.bg--red {
 background-color: #e74c3c;
}
.tx--red {
 color: #e74c3c;
}
.bd--blue {
 border: 4px solid #1e8bc3;
}
.bg--blue {
 background-color: #1e8bc3;
}
.tx--blue {
 color: #1e8bc3;
}
.bd--green {
 border: 4px solid #26a65b;
}
.bg--green {
 background-color: #26a65b;
}
.tx--green {
 color: #26a65b;
}
.bd--grey {
 border: 4px solid #6c7a89;
}
.bg--grey {
 background-color: #6c7a89;
}
.tx--grey {
 color: #6c7a89;
}
.bd--purple {
 border: 4px solid #8e44ad;
}
.bg--purple {
 background-color: #8e44ad;
}
.tx--purple {
 color: #8e44ad;
}
.bd--white {
 border: 4px solid #ecf0f1;
}
.bg--white {
 background-color: #ecf0f1;
}
.tx--white {
 color: #ecf0f1;
}
/**
* Images
*/
img {
 max-height: 300px;
}
img.dw-pnl__cntnt,
img.dw-flp__pnl {
 padding: 0;
}
img.dw-flp__pnl {
 max-height: 100%;
}
@-webkit-keyframes fade {
 from {
 opacity: 0;
 }
 to {
 opacity: 1;
 }
}
@keyframes fade {
 from {
 opacity: 0;
 }
 to {
 opacity: 1;
 }
}

External CSS

This Pen doesn't use any external CSS resources.

External JavaScript

This Pen doesn't use any external JavaScript resources.