I have an <img>
in an <a>
and there is a random additional space at the bottom:
a {
text-decoration: none;
color: inherit;
display: inline-block;
position: relative;
margin: 0;
padding: 0;
border: 1px solid red;
}
img {
margin: 0;
padding: 0;
}
<span><a target="_blank" href="#test"><img border="0" referrerpolicy="origin" src="http://via.placeholder.com/300/E8117F/ffffff" height="300" width="300"></a></span>
The link should exactly wrap the image, but there is a white space at the bottom that shouldn't be there:
How do I get rid of this space? I don't want to set overflow: hidden
or otherwise clip the content - the height and width of the image can change and I want the <a>
to stretch.