I'm not getting it why the property not works sometimes. How to fix this issue? You can see the shadow is at the upper layer. Why it is not going down or the other not coming forward?
*{
margin: 0;
padding: 0;
}
body , html{
height: 100%;
}
section{
position: relative;
top: 50%;
height: 50%;
background: linear-gradient(to bottom, #e3e5e7, #fef9fa);
}
div{
position: absolute;
top: 0;
left: 50%;
transform: translate(-50%, -50%);
width: 180px;
height: 180px;
border-radius: 50%;
background: white;
box-shadow: inset 25px -25px 35px rgba(100, 100, 100, 0.5);
z-index: 2;
}
div::before{
content: '';
/* display: block; */
position: absolute;
bottom: 0;
width: 180px;
height: 45px;
background: gray;
border-radius: 50%;
left: -100%;
transform: translate(50%, 22px);
filter: blur(5px);
z-index: -5;
}
<section>
<div class="ball"></div>
</section>