I'm currently trying to create an image with a gradient that disappears on hover, but I'm struggling to get the transition effect to work. I've experimented with various webkit transitions without success.
Here's the HTML:
<a href="http://calvarygigharbor.com/heavenly-hitters/">
<div class="tinted-image"> </div></a>
And here's the CSS I'm using:
.tinted-image {
-webkit-transition: all .7s ease;
transition: all .7s ease;
position: relative;
width: 100%;
padding-top: 56.25%; /* 16:9 Aspect Ratio */
border-radius: 10px;
background:
linear-gradient(
rgba(255, 0, 0, 0.6),
rgba(237,240,0,0.6)
),
/* image */
url(http://calvarygigharbor.com/wp-content/uploads/2018/05/church-softball-2018.jpg);
background-size: contain;
}
.tinted-image:hover {
-webkit-transition: all .7s ease;
transition: all .7s ease;
position: relative;
width: 100%;
padding-top: 56.25%; /* 16:9 Aspect Ratio */
border-radius: 10px;
background:
/* image */
url(http://calvarygigharbor.com/wp-content/uploads/2018/05/church-softball-2018.jpg);
background-size: contain;
}
Despite the picture and hover functioning correctly, the transition is not working as intended. Any tips on how to fix this?
URL: