I know this is a super basic concept but I'm going around in circles. I have a background image with text on top. So the image is the parent element. When the user hovers over the image, I want there to be a black gradient that is darker than the initial one I used, so that the image still shows and the text is still clear.
I have tried using z-index, only using background color, removing opacity. Just about everything. When I hover, the h1 and p text gets covered and the hover color is white/grey and not black.
This is the code I'm using for the hover:
.image {
position: relative;
width: 100%;
max-width: 900px;
margin: auto;
background: linear-gradient(180deg, rgba(38, 36, 36, 0.47) 0%, rgba(38, 36, 36, 0) 100%), url(/assets/img/pictures/feature.png);
background-size: cover;
}
.image:hover{
box-shadow: 0px 4px 4px rgba(0, 0, 0, 0.25);
background: rgba(0, 0, 0, 0.5);
opacity: 0.4;
}
<div class="image overlay blog-page" style="margin-bottom: 75px;">
<h1 class="article">Featured Page</h1>
<div class="row" style="margin-left: 24px;">
<div class="col-xs">
<img class="author-image" src="/assets/img/pictures/test.png"></img>
</div>
<div class="col-xs">
<p class="article-content banner-text author">Test</p>
</div>
</div>
</div>
Am I missing something very obvious? Any help would be appreciated.