I've been struggling to add a box shadow on hover to a Facebook icon image. I assumed it would be straightforward, but as always, I was wrong. I'm working with a child theme in WordPress because I recently started, thinking it would be an easy way to begin. At first, I suspected that the child theme might be causing the issue. However, when I tried using JSFiddle, I still couldn't make it work.
Here's the code from JSFiddle:
HTML
Example 1
<a href="..." target="_blank">
<img class="icon" src="..." alt="facebook icon" align="right" />
</a>
Example 2
<div class="icon">
<a href="..." target="_blank"><img src="..." alt="facebook icon" align="right" />
</a></div>
CSS
.icon {
text-align: right;
box-shadow: none ! important;
border-radius: 7px;
margin-left: 5px;
margin-top: -5px;
margin-right: 10px;
height: 45px;
width: 45px;
}
.icon a:hover {
border-radius: 7px;
box-shadow: 5px 5px 5px rgba(0, 255, 0, 0.1);
}
I welcome any suggestions you may have. Thank you in advance!
You can also check out the link here: