0

This is the html i have:

<a id="test" href="monogram/index.html">
        <img src="img/MonogramApartmentNS.png" alt="The image">
</a>

This is the css:

#test {
  display: inline-block;
  width: 40.0rem;
}

#test img {
  width: 100%;
}

The image link works. In css I set the to display as an inline-block, but the height of the doesn't match the height of the img. It's 5px higher then the image it contains. How do i get the to be the exact same height as the image it contains? I need this because I am using borders around the tag.

A few images: The height of the image

The height of the link

Bram
  • 444
  • 1
  • 5
  • 18

1 Answers1

4

The problem was the image, making the image display: block; should fix it.

Bram
  • 444
  • 1
  • 5
  • 18