JSFiddle - React, Tailwind, and code Playground
by BurpmanJunior
HTML
<div>1</div>
<div>2</div>
<div>3</div>
<div>4</div>
<div>5</div>
CSS
*{
box-sizing: border-box;
}
div {
display: block;
font-size: 60px;
font-family: sans-serif;
font-weight: bold;
line-height: 1;
position: relative;
text-align: center;
color: #999;
background-color: rgba(0, 0, 0, 0.1);
padding: 10% 2%;
transition: all 300ms;
width: 100%;
left: 0;
}
@media screen and (min-width: 640px) {
div {
margin-bottom: -20px;
width: 33.333%;
}
div:nth-child(2n) {
left: 33.333%;
}
div:nth-child(5n+3) {
left: 66.666%;
}
}
JavaScript
/**
* WAVE LAYOUT
*/