JSFiddle - React, Tailwind, and code Playground
HTML
<div class="overlay"></div>
<div class="rect rect-1"></div>
<div class="rect rect-2"></div>
<div class="rect rect-3"></div>
CSS
body {
height: 100%;
margin: 0;
padding: 0;
background: yellow;
}
.overlay {
position: absolute;
width: 100%;
height: 100%;
background: rgba(0,0,0,0.5);
z-index: 1;
}
.rect {
position: absolute;
border: 1px solid white;
z-index: 2;
}
.rect-1 {
left: 50px;
top: 50px;
width: 50px;
height: 50px;
}
.rect-2 {
left: 150px;
top: 150px;
width: 100px;
height: 25px;
}
.rect-3 {
left: 400px;
top: 80px;
width: 70px;
height: 45px;
}