JSFiddle - React, Tailwind, and code Playground
by moob
HTML
<section>
<div id="a"></div>
<div id="b"></div>
<div id="c"></div>
<div id="d"></div>
</section>
CSS
section {
position: relative;
background: blue;
width: 300px;
height: 300px;
}
section>div {
position: absolute;
background: white;
border-radius: 6px;
background-image: url('http://placekitten.com/300/300');
background-position: calc(0px - var(--left)) calc(0px - var(--top));
}
#a {
--top: 60px;
--left: 10px;
top: var(--top);
left: var(--left);
width: 60px;
aspect-ratio: 1;
}
#b {
--top: 10px;
--left: 75px;
top: var(--top);
left: var(--left);
width: 80px;
aspect-ratio: 1/2;
}
#c {
--top: 30px;
--left: 160px;
top: var(--top);
left: var(--left);
width: 60px;
aspect-ratio: 1;
}
#d {
--top: 95px;
--left: 160px;
top: var(--top);
left: var(--left);
width: 40px;
aspect-ratio: 1;
}