JSFiddle - React, Tailwind, and code Playground
HTML
<div class="picture-viewer">
<div class="picture-viewer-frame"> <!--Element to position to fit the child image size -->
<img src="https://post.greatist.com/wp-content/uploads/sites/3/2020/02/325466_1100-1100x628.jpg">
<div class="picture-viewer-frame-header">
Header Text
</div>
</div>
</div>
CSS
*
{
box-sizing: border-box;
}
body
{
background-color: tomato;
}
.picture-viewer
{
position: fixed;
display: flex;
width: 100%;
height: 100%;
z-index: 20;
top: 0px;
justify-content: center;
align-items: center;
}
.picture-viewer-frame
{
position: relative;
display: flex;
width: 85%;
height: 85%;
justify-content: center;
align-items: center;
background-color: rgba(0, 0, 0 , 0.25);
}
.picture-viewer-frame img
{
max-width: 100%;
max-height: 100%;
box-shadow: 0px 0px 15px 2px rgba(0, 0, 0, 0.35);
}
.picture-viewer-frame-header
{
position: absolute;
display: flex;
top: 0px;
left: 0px;
width: 100%;
height: 65px;
background-color: rgba(255, 255, 255, 0.1);
color: white;
align-items: center;
padding-left: 15px;
}