HTML: link containing an image

If you’re link contains an image, add a height:100% style to the anchor tag. The height of the anchor will be the same as the height of the image. In this case the container div also inherits the correct height.

<a style="display: block;" href="">
  <img id="image" style="height: auto;" alt="image" src="image.jpg" />

Leave a Reply