You are trying to set an icon image on a link using a background image that can be moved to a hover event.
The easiest way to do this:
HTML can be as simple as:
<a class="test" id="test" href="#"></a>
and apply the following CSS:
.test { background: beige url(http://placekitten.com/50/50) center center no-repeat; display: inline-block; width: 50px; height: 50px; border: none; }
Apply the background image to the link ( a ) tag instead of the img tag, which is not needed.
See demo at: http://jsfiddle.net/audetwebdesign/qAeHL/
source share