0

Just like on this example: http://jsfiddle.net/sbefc58t/2/

When I have images wrapped in a link it adds space below the image. How do I get rid of this?

<div class="top">
    <a href="/">
        <img src="http://static.giantbomb.com/uploads/screen_medium/11/118253/2220255-wolf3d_dos.png" />
    </a>
</div>  

.

*{padding:0;margin:0;}
.top{ background: grey; border-radius: 3px; margin: 5px 0; overflow: hidden; }
a{line-hight:0;}
Tristan Cunningham
  • 909
  • 2
  • 10
  • 24

2 Answers2

4

JSFiddle - DEMO

Use vertical-align: middle; to img

img {
    vertical-align: middle;
}
Anonymous
  • 10,002
  • 3
  • 23
  • 39
1

Just add display: block in img:

img{display: block;}

fiddle

Alex Char
  • 32,879
  • 9
  • 49
  • 70