This question is pretty basic, but I want to be sure there isn't an alternative method than what I currently do. Let's say I have a Facebook icon. As of now, when a user hovers over that image, I display a different image in order to change the color. Is there an alternative CSS method to doing this, so I am not using multiple images?
In the fiddle below, I tried changing the background, but that just covers the entire image.
.social-icon {
width: 20px;
height: 20px;
transition: ease .3s;
-webkit-transition: ease .3s;
margin-right: 5px;
cursor: pointer;
}
#facebook-icon {
background-image: url(https://s3.us-east-2.amazonaws.com/optimumdesigns/facebook-logo-gray.png);
background-size: 20px 20px;
}
#facebook-icon:hover {
background: #FFF;
}
<div class="social-icon" id="facebook-icon"></div>