JSFiddle - React, Tailwind, and code Playground

by CSS_Apprentice

HTML

<div class="container blue">
    
</div>

<div class="container yellow">
    <p class="main">I Want The Text To Overlay</p>
    <p class="overlay">I Want The Text To Overlay</p>
</div>

<div class="container red">
    
</div>

CSS

.container {
    height: 150px;
    width: 500px;
    margin: 0 auto;
    position: relative;
}

.container p:first-child {
    z-index:2;
}

.overlay {
    position: absolute;
    top: 0;
    margin: .1%;
    color: white;
}

p {
    font-size: 2em;
    margin: 0;
    padding: 0;
}

.main {
    z-index: 2;
}


/* Background Colors */
.blue {
    background-color: blue;
}
.yellow {
    background-color: yellow;
}
.red {
    background-color: red;
}