JSFiddle - React, Tailwind, and code Playground
by Joseph Turner
HTML
<div class="container">
<div class="branch_1">
<div class="branch_1__child"></div>
</div>
<div class="branch_2">
<div class="branch_2__child"></div>
</div>
</div>
CSS
.container {
width:400px;
height:400px;
background-color:gray;
position:relative;
}
.branch_1 {
width:300px;
height:300px;
background-color:green;
position:absolute;
z-index:1;
top:0;
left:0;
}
.branch_2 {
width:300px;
height:300px;
background-color:blue;
position:absolute;
z-index:1;
bottom:0;
right:0;
}
.branch_1__child {
width:200px;
height:200px;
background-color:lightgreen;
position:absolute;
z-index:99;
top:50%;
left:50%;
margin-top:-100px;
margin-left:-100px;
}
.branch_2__child {
width:200px;
height:200px;
background-color:lightblue;
position:absolute;
z-index:1;
top:50%;
left:50%;
margin-top:-100px;
margin-left:-100px;
}