Mind Dump, Tech And Life Blog
written by Ivan Alenko
published under license Attribution-ShareAlike 4.0 International (CC BY-SA 4.0)copy! share!
posted at 12. May '21

HOWTO Remove Empty Bottom Space After img Element

There is an empty space at the bottom, after the img element by default. Get rid of it by setting font size and line height to 0. An image has no text anyways.

.image-container {
  font-size: 0;
  line-height: 0;
}

This should help in majority of cases, but there are also heavier guns..

Add Comment