Categories
CSS

How to fix image inside div has extra space below the image with CSS?

Spread the love

To fix image inside div has extra space below the image with CSS, we make the image a block element.

For instance, we write

img {
  display: block;
}

to make the image a block element with display: block; to remove the space below the image.

By John Au-Yeung

Web developer specializing in React, Vue, and front end development.

Leave a Reply

Your email address will not be published. Required fields are marked *