CSS: lh units
LH units are cool. By Andy Bell.
Historically, I’ve used
em
,ch
andex
units to size icons in contexts like buttons so font sizes icon sizes are nice and synced. Usingex
units is especially useful because1ex
is the height of the x character in the chosen font and size.The
lh
unit is even more useful though because it is relative to the computed line height. This makes sizing icons relatively and aligning them relatively, much easier.
Good browser support, too.