I want to add linear Gradient transition on hover.
I did some research and found how it works but unfortunately they work only for buttons etc whereas I want it on an image .
I have added an image using css property background-image . And I want that when user hover the image the image shows linear gradient with transition .
Here is the code .
.project-1 {
background-image: url("https://cdn.pixabay.com/photo/2018/03/11/20/42/mammals-3218028_960_720.jpg");
width: 350px;
height: 250px;
background-position: center;
background-size: cover;
transition: transform 0.5s , opacity 0.5s;
}
.project-1:hover {
background-image: linear-gradient(rgba(0, 0, 0, 0.39) , rgba(0, 0, 0, 0.39)) , url("https://cdn.pixabay.com/photo/2018/03/11/20/42/mammals-3218028_960_720.jpg");
background-position: center;
background-size: cover;
transform: scale(1.05);
}
<div class="project-1"></div>
The topics I found on stackoverflow have buttons or simple background without any image.
(The Image I used in the code is just for snippet)