How to keep an icon proportional to a text label
Answer in brief
Size the graphic in em units when it should scale with the text of its component. Give the width and height the same value for square artwork.
Scale a download link
Set both dimensions to 1em on an arrow beside “Download”. Compare a 14-pixel table link and a 20-pixel heading link. Check the arrow on a second line as well as beside a single-line label.
Check the visible weight at larger sizes
A one-em square includes any transparent margin in the source. Compare two different icons next to the same heading at 14 and 24 pixels. If one looks small at both sizes, measure the painted area and normalize the source bounds before introducing a different size token for each glyph.
Sources
- [1] CSS Values and Units Module Level 4 — W3C, accessed November 23, 2026
Frequently asked questions
Why is my icon larger than its neighboring text?
An em uses the element's computed font size in these dimension properties. Look for a font-size override on the image or its wrapper.