JSFiddle - React, Tailwind, and code Playground

HTML

<div id="target">
    <div>div</div>
</div>

CSS

#target {
    position: relative;
    width: 200px;
    height: 200px;
    z-index: 1;
}
#target>div{
    position: relative;
    background: red;
    width: 200px;
    height: 200px;
    z-index: 0;
}
#target:before {
    content: "after";
    position: absolute;
    top: 0;
    left: 10%;
    width: 100%;
    height: 100%;
    background: cyan;
    z-index: 10;
}