I have an image with some text positioned over it.
When I hover the cursor over the image, I change the color of box-shadow.
Unfortunately, when the cursor reaches the text overlaid on top of the image, the background image loses the hover effect.
How can I keep the hover effect on the image, while the cursor is on the nephew text element?
HTML
<div class="col-xs-6 col-sm-3">
<a href="#">
<img src="http://via.placeholder.com/270x200.png">
<div class="text-overlay">
<h2><span>Example</span><br>Overlay<br>Text</h2>
</div>
</a>
</div>
CSS
img {
margin-top: 20px;
border-radius: 10px;
box-shadow: 0px 0px 0px 2px #b2b2b2;
}
img:hover {
box-shadow: 0px 0px 0px 2px #f47c20;
}
.text-overlay {
color: #fff;
position: absolute;
top: 40px;
left: 32px;
}
Example codepen: https://codepen.io/Washable/pen/bLGqbP