Bobby Smith

Bobby Smith

Experience Designer.

Remove white space beneath an image with CSS

02 July, 2015

Because the <img> tag is an inline element you get a space at the bottom of images to account for descenders in type (‘y’, ‘p’, ‘q’, ‘j’) create a white space or ‘margin’. To prevent this, set the image to display:block;.


See the Pen no img white-space by Bobby Smith (@b00y0h) on CodePen