On an html5 webpage I have a hover-effect. Like this:
a:hover {
background: #EFEFEF;
}
I also have a list of images with links:
<a href="x">
<img src="images/y.png" />
</a>
When hovering over those links, a #EFEFEF-colored line appears under the image. How do I remove that?
It’s not the text-decoration: underline, also fiddling with padding didn’t work.
You’re likely seeing the background of the anchor beneath the image. Set the image’s display to block:
Before and After Demo: http://jsbin.com/enikoz/edit#preview
Keep in mind though that converting an inline image into a block element can affect our layout.