JSFiddle - React, Tailwind, and code Playground
HTML
<div class="overlay"><p>This is the content of the overlay. Really informative stuff.</p></div>
<!-- Just some background image -->
<div class="cat"></div>
CSS
.overlay {
position: absolute;
z-index: 1000; /* Something high */
height: 200px;
width: 200px;
background: white;
top: 50%;
left: 50%;
margin-left: -100px; /* Negative half width */
margin-top: -100px; /* Negative half height */
box-shadow: 0 0 0 2038px rgba(0,0,0,.5); /* The semi-transparent bg. Something weird about Safari and numbers bigger than 2038 */
-webkit-transition: 1s; /* Little extra spice */
border-radius: 5px;
}
/* just needed some styling love */
.overlay p {
padding: 15px;
margin: 0;
font-family: sans-serif;
font-size: 12px;
}
/* because we need something in the background */
.cat {
background-image: url('http://payload170.cargocollective.com/1/0/128/5713421/boulle10_905.jpg');
background-size: cover;
width: 100%;
height: 100%;
position: absolute;
top: 0;
left: 0;
}