3 ms·
If the font size is different, em width adapts to that, px width doesn't. Text occupies space in pixels, but not vice versa.
by GoblinSlayer 6y ago
If the font size is different, em width adapts to that, px width doesn't. Text occupies space in pixels, but not vice versa.
- lhorie 6y agoYes I'm aware of that. But regardless of whether you mean this in the sense of adapting to user stylesheets or the idea that disparate elements' font sizes should relate to each other, they both strike me as maintainability trade-offs that can reasonably go either way. An elitist tone seems a bit unnecessary in that context.
- GoblinSlayer 6y agoThe font size can change due to zoom, which is a must, because 16px is too small text and unreadable.
- lhorie 6y agocmd+"+" has always worked regardless of what unit is used, though?
- GoblinSlayer 6y agoElements measured in pixels (like images) don't change size when text changes size.