I am facing an issue where a div with a box-shadow and an h1 inside are not aligned properly, causing the shadow to not cover the h1 element.
Below is the code snippet in question:
h1 {
position: absolute;
top: 50%;
left: 44%;
-webkit-transform: translate(-44%, -50%);
transform: translate(-44%, -50%);
margin: 0;
font-size: 120px;
text-align: center;
}
#div{
width:100%;
box-shadow:inset 0 0 0 1000px rgba(255,0,0,0.5);
height:400px;
}
<div id="div"><h1>hi</h1></div>