CSS pseudo element before coming on top of the container instead behind of container.

hey folks I have this div
<Box className={styles.celebrityNights}>
<Typography sx={{fontSize: '3rem'}}>Dj Shameless Mani</Typography>
<Typography sx={{fontSize: '1.6rem'}}>10th March</Typography>
</Box>
<Box className={styles.celebrityNights}>
<Typography sx={{fontSize: '3rem'}}>Dj Shameless Mani</Typography>
<Typography sx={{fontSize: '1.6rem'}}>10th March</Typography>
</Box>
with the following CSS
.celebrityNights {
display: flex;
flex-direction: column;
gap: 0.5rem;
text-align: center;
cursor: default;
padding: 1rem;
position: relative;
background: #17181F;
overflow: hidden;
}

.celebrityNights::before {
content: '';
position: absolute;
top: 0;
left: 0;
width: 100%;
height: 100%;
background: linear-gradient(#4150d0, #c850c0);
}
.celebrityNights {
display: flex;
flex-direction: column;
gap: 0.5rem;
text-align: center;
cursor: default;
padding: 1rem;
position: relative;
background: #17181F;
overflow: hidden;
}

.celebrityNights::before {
content: '';
position: absolute;
top: 0;
left: 0;
width: 100%;
height: 100%;
background: linear-gradient(#4150d0, #c850c0);
}
I don't know why the before pseudo element is coming on top of the container instead behind of container, I have attached the image
1 Reply
Unknown User
Unknown User2y ago
Message Not Public
Sign In & Join Server To View
Want results from more Discord servers?
Add your server