JSFiddle - React, Tailwind, and code Playground
HTML
<p align="center"><a href='#' onclick='overlay()'>Click here to show the overlay</a></p>
<p align="center">this is my text... this is my text... this is my text... this
is my text... this is my text... this is my text...this is my text... this
is my text... this is my text... this is my text...</p>
<p align="center"><b>this is my text... this is my text... this is my text... this
is my text... t</b></p>
<div id="overlay">
<div>
<p>Content you want the user to see goes here.</p>
<a href="javascript:close()">Close</a>
</div>
</div>
CSS
.close { text-decoration: underline }
#overlay {
visibility: hidden;
position: fixed;
left: 0;
top: 0;
width: 100%;
height: 100%;
text-align:center;
z-index: 200;
background-image:url(maskBG.png);
background-color: black;
opacity:0.9;
}
#overlay div {
width:300px;
margin: 100px auto;
background-color: #fff;
border:1px solid #000;
padding:15px;
text-align:center;
}
JavaScript
function overlay(){
el = document.getElementById("overlay");
el.style.visibility = (el.style.visibility == "visible") ? "hidden" : "visible";
}
function close() {
document.getElementById("overlay").style.visibility = 'hidden';
}