Skip to content
Product and web UIguide

Why does an inline icon leave a gap underneath?

By SkeuDesign Editorial Team1 min read

Answer in brief

Inline images participate in a text line and ordinarily align to its baseline. Pick the alignment that matches the icon's job in the surrounding layout.

Separate two common cases

A standalone thumbnail can use display: block to remove the text-line gap. For a paperclip beside a filename, keep it inline and try vertical-align: middle. Check a filename with descending letters such as “page.jpg”.

Separate baseline space from export padding

Give the image and its parent different temporary background colors. Space inside the image rectangle points to transparent artwork margins. A strip below the rectangle inside the parent points to line layout. This distinction matters for reusable icons because trimming a perfectly good export can misalign it everywhere else.

Sources

  1. [1] vertical-align CSS property - CSS — MDN Web Docs, accessed November 23, 2026

Frequently asked questions

Why does middle look slightly off-center?

Middle aligns relative to the parent baseline and x-height. Font metrics and transparent margins can still change how the artwork looks.