Solution 1 :

Images are rendered inline by default, so that space at the bottom is accommodating text decenders. You can set display: block; on the image to remove the space.

More information in this answer.

Problem :

I feel like such a newb asking this, but I can’t figure out why any div container seems to always be taller than the content that it contains. See for working example.

.container { 
  height: fit-content;
  width: fit-content;
  padding: 0;
<div class="container">
  <img src="" height="350" width="350">

It’s like there’s always 5px of padding on the bottom, even though I’ve specifically said not to.