Hi! So the trick here is that you can only set a z-index on elements that are positioned.
Because you’re not overtly setting the position of your ‘.content’ div, it’s defaulting to position: static, which doesn’t allow it to take the z-index you’re giving it.
.content {
z-index: 3;
position: relative; <--- add this
}
uhm., yeah. everyone has already said this., but let me take it a step further.
if you want your .section to be below everything,. it’s better to give it a z-index: -1000.
then you can give the .overlay a z-index: -500
Then every new element you make doesn’t require a z-index.
However, if you stick to the approach of using a positive z-index to .section & .overlay it now forces you to add a z-index to every new div,. that you want on top.
well, it works yea, that overlay div is useless now, the use of it was adding a shade of yellow to the page, so i stacked divs.
But i guess that’s another way to do it, just using a background color with hsla to make it show what’s beneath it .
@Simply_abdou yes my brother, there are multiple ways to approach it.
There is another way which uses only one div and background: with multiple arguements like this
HTML: