JSFiddle - React, Tailwind, and code Playground

by Softlink

HTML

<div class="wrap">
    <div class="block one"><span></span></div>
    <div class="block two"><span></span></div>
    <div class="block three"><span></span></div>
    <div class="block four "><span></span></div>
</div>

CSS

.wrap{
    overflow: hidden;
    margin: -2px;
    padding: 2px;
}

.block{
    position: relative;
    float: left;
    width: 22%;
    height: 100px;
    margin-left: 4%;
    box-shadow: 0 0 0 1px #ccc;
}

.block:first-child{
    margin-left: 0;
}

span{
    position: absolute;
    left: 50%;
    top: 50%;
    background: #ccc;
}

.one span{
    width: 100px;
    height: 20px;
    margin: -10px 0 0 -50px;
}

.two span{
    width: 20px;
    height: 50px;
    margin: -25px 0 0 -10px;
}

.three span{
    width: 74px;
    height: 60px;
    margin: -30px 0 0 -37px;
}

.four span{
    width: 30px;
    height: 50px;
    margin: -25px 0 0 -15px;
}