-
Notifications
You must be signed in to change notification settings - Fork 756
Open
Labels
Milestone
Description
vertical-align: middle will align an element with the baseline of text minus half its x-height. This makes it a poor fit for glyph-sized elements like icons, which will always look a tad too low. Ideally we’d have a keyword (vertical-align: text-middle?) that would align with the middle of the cap height of the typeface instead…
In lieu of this property, I see two dominant techniques for accomplishing this:
- The icon position is adjusted manually, using
top: -1pxor similar. This requires the icon to beinline-block, since other positioning techniques will conflict with thetopvalue. - The icon and text must be wrapped in a container with
display: flex; align-items: centeror similar. But this prevents the icon from being used inline.
(I was encouraged to submit this issue after writing about the idea.)
simevidas, mvsde, chadanuk, tomb1n0, dwelle and 32 morederekshirk, Paul-Hebert, Schweinepriester, OliverJAsh, luisadame and 6 more
