JSFiddle - React, Tailwind, and code Playground

by pleinx

HTML

<div class="container">
    <div></div>
    <div></div>
    <div></div>
    <div></div>
    <div></div>
    <div></div>
    <div></div>
    <div></div>
    <div></div>
    <div></div>
    <div></div>
    <div></div>
    <div></div>
    <div></div>
    <div></div>
    <div></div>
    <div></div>
    <div></div>
    <div></div>
    <div></div>
</div>

CSS

.container {
    width: 80%;
    height: 500px;
    margin: 30px auto;
    background: #eee;
    position: relative;
}
.container:before {
    content: ' ';
    position: absolute;
    top: 0;
    bottom: 0;
    left: 0;
    right: 0;
    border: 2px solid #eee;
}
.container div {
    float: left;
    width: 25%;
    height: 20%;
    border: 2px solid #aaa;
    margin: 0; padding: 0;
    -webkit-box-sizing: border-box;
    -moz-box-sizing: border-box;
    box-sizing: border-box;
}

@media screen and (max-width: 1000px) {
  .container > div {
    width: 33.33%;
  }
}