Implementing vertical-align: middle to img elements ensures proper functionality of links wrapping images
Setting display: block; on img as suggested in <a href="https://stackoverflow.com/a/38091633/895245">this answer</a> can work, but it may result in the link being clickable outside the image area to the right if wrapped with an anchor tag.</p>
<p>Alternatively, utilizing <code>vertical-align: middle
as recommended in this post about extra space below images inside divs resolves that issue:
<div style="background-color: blue;">before</div>
<div>
<a href="http://example.com">
<img src="https://upload.wikimedia.org/wikipedia/commons/thumb/e/e9/Chick.jpg/320px-Chick.jpg" style="background-color: red; vertical-align: middle;">
</a>
</div>
<div style="background-color: green;">after</div>