4 ms·
> …there are legitimate reasons to use pixels sometimes, but resolution independent font-size and container sizing should be the default. Web pixels are differ
by CharlesW 6y ago
> …there are legitimate reasons to use pixels sometimes, but resolution independent font-size and container sizing should be the default.
Web pixels are different than device pixels, and are resolution independent.
- kevincox 6y agoThe are independent of the screen but also of the user preferences. Using rem or relative sizes bases your sizing off of the user's selected font size. As soon as you size something in px you have just thrown away the user's font size choice.
- charrondev 6y agoThis doesn’t seem accurate. Items sized in pixels will get increased with CTRL + “+”.
- kevincox 6y agoI believe that that zoom is handled differently from default font size.
- pwdisswordfish0 6y agoCtrl++ is only necessary because you've "thrown away the user's font size choice". As a user, I have my font preferences set to what I want to read. If you maintain main body text size = 1em, then those preferences are respected. If you start arbitrarily specifying font size in px (whether CSS px or physical px), then you destroy that. This can still happen with 1em, too, by opting for a font whose em box is screwed up, as described in the article, but that's the _easiest_ thing to test for, because it will be apparent on all screens (including the designer's).
- danShumway 6y agoYes, correct, I should have been more specific. The resolution of the webpage as reported by the webpage, even if it doesn't line up with the literal number of pixels in a screen, should not be used for font sizing in most scenarios.