I made a very basic hero section with a background and an overlay.
.hero
width: 100%
height: 100vh
position: relative
background-image: url('../assets/hero.png')
background-position: center
background-repeat: no-repeat
background-size: cover
&:before
content: ''
position: absolute
top: 0
right: 0
bottom: 0
left: 0
background: $secondary-blue
opacity: .5
overflow: hidden
z-index: 1
.hero--welcome
display: flex
align-items: center
justify-content: center
flex-direction: column
align-items: left
width: 100%
height: 100%
z-index: 2
<div className="hero">
<div className="hero--welcome">
<h6>Welcome to</h6>
<h1>Alhandsya</h1>
</div>
</div>
But the text at hero--welcome
is showing in a really dark way under the overlay and I want it to go over it, how do I do it? I tried z-index
but didn't work.