JSFiddle - React, Tailwind, and code Playground

by Stéphane LEGRAND

HTML

<div class="cadre1">
    <span></span>
</div>
<div class="cadre2">
    <span></span>
</div>
<div class="cadre3">
    <span></span>
</div>

CSS

.cadre1, .cadre2, .cadre3 {
    background:#eee;
    border:#000 2px solid;
    display:inline-block;
    margin-bottom:20px;
    position:relative;
    z-index:1;
}

.cadre1 {
    width:25%;
    height:100px;
    margin-right:5%;
}

.cadre2 {
    width:60%;
    height:100px;
}

.cadre3 {
    width:91%;
    height:200px;
}
.cadre1 span {
    position:absolute;
    height:2px;
    background:#000;
    display:block;
    top:49px;
    left:-13px;
    right:-13px;
    bottom:0;
    transform:rotate(26deg);
    z-index:2;
}
.cadre2 span {
    position:absolute;
    height:2px;
    background:#000;
    display:block;
    top:49px;
    left:-7px;
    right:-7px;
    bottom:0;
    transform:rotate(11.5deg);
    z-index:2;
} 
.cadre3 span {
    position:absolute;
    height:2px;
    background:#000;
    display:block;
    top:99px;
    left:-13px;
    right:-13px;
    bottom:0;
    transform:rotate(15.5deg);
    z-index:2;
}

.cadre1 span:before {
    content: "";
    position:absolute;
    height:2px;
    background:#000;
    display:block;
    top:0;
    left:0;
    right:0;
    bottom:0;
    transform:rotate(-52deg);
    z-index:2;
}
.cadre2 span:before {
    content: "";
    position:absolute;
    height:2px;
    background:#000;
    display:block;
    top:0;
    left:0px;
    right:0px;
    bottom:0;
    transform:rotate(-23deg);
    z-index:2;
} 
.cadre3 span:before {
    content: "";
    position:absolute;
    height:2px;
    background:#000;
    display:block;
    top:0;
    left:0;
    right:0;
    bottom:0;
    transform:rotate(-31deg);
    z-index:3;
}