The 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.
Re:Let’s fix font size
by charrondev on Tuesday March 30, 2021 @03:59PM
(#26639630)
This doesn’t seem accurate. Items sized in pixels will get increased with CTRL + “+”.
Re:Let’s fix font size
by pwdisswordfish0 on Tuesday March 30, 2021 @08:39PM
(#26642273)
Ctrl++ 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).
I believe that that zoom is handled differently from default font size.
Re:Let’s fix font size
by danShumway on Tuesday March 30, 2021 @03:06PM
(#26638931)
Yes, 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.
Web pixels are different than device pixels, and are resolution independent.