JSFiddle - React, Tailwind, and code Playground
HTML
<div class="content">
<span class="overlay">X</span>
X
</div>
<div class="content">
<span class="overlay">Y</span>
Y
</div>
<div class="content">
<span class="overlay">Z</span>
Z
</div>
CSS
body {
background: #000;
}
.content {
display: inline-block;
position: relative;
font-size: 50px;
color: grey;
text-shadow: yellow 2px 2px;
}
.overlay {
width: 70%;
height: 70%;
position: absolute;
color: red;
overflow: hidden;
text-shadow: white 2px 2px;
}