JSFiddle - React, Tailwind, and code Playground

by Brodingo

HTML

<div class="x"></div>
<div class="x small"></div>
<div class="x big"></div>

CSS

div {
    width: 200px;
    height: 200px;
    margin: 20px;
    background-color: gainsboro;
}

.x {
    position: relative;
}

.x:before,
.x:after {
    content: ' ';
    position: absolute;
    top: 50%;
    width: 100%;
    height: 20%;
    margin-top: -10%;
    background-color: steelblue;
    -webkit-transform: rotate(45deg);
}

.x:after {
    -webkit-transform: rotate(-45deg);
}

.small {
    width: 20px;
    height: 20px;
}

.big {
    width: 400px;
    height: 400px;
}