JSFiddle - React, Tailwind, and code Playground
by Nicolas PUJOL
HTML
some content
<div class="overlay">
<div class="parent">
<div class="child">
<img src="http://lorempicsum.com/futurama/200/200/1" alt="image" />
</div>
</div>
</div>
CSS
html, body {
height: 100%;
width: 100%;
margin: 0;
padding: 0;
}
.parent {
background-color: rgba(255, 0, 0, 0.8);
position: relative;
height: 100%;
width: 100%;
}
.overlay {
position: absolute;
width:100%;
height: 100%;
top: 0;
left:0;
}
.child {
position: absolute;
top: 0;
bottom: 0;
left:0;
right:0;
margin: auto;
width:50%;
background-color: blue;
text-align: center;
}
JavaScript
$("#lv").show();