3 ms·
> it appears that the default font size for most browsers is 16px, so 38rem is 608px What does px mean in CSS? I thought it was pixels but clearly not...
by chrisseaton 8y ago
> it appears that the default font size for most browsers is 16px, so 38rem is 608px
What does px mean in CSS? I thought it was pixels but clearly not...
- deleted 8y ago[deleted]
- uranusjr 8y agoIt is defined as a small but visible size. Whatever that should be is left to the implementers.
- Raphmedia 8y ago"The px unit is the magic unit of CSS. It is not related to the current font and usually not related to physical centimeters or inches either. The px unit is defined to be small but visible, and such that a horizontal 1px wide line can be displayed with sharp edges (no anti-aliasing). What is sharp, small and visible depends on the device and the way it is used: do you hold it close to your eyes, like a mobile phone, at arms length, like a computer monitor, or somewhere in between, like an e-book reader? The px is thus not defined as a constant length, but as something that depends on the type of device and its typical use." https://www.w3.org/Style/Examples/007/units.en.html https://www.w3.org/Style/Examples/007/units.en.html
- chrisseaton 8y ago> What is sharp, small and visible depends on the device and the way it is used How can you use this vague definition to do anything useful? I would imagine they simply mean 'it's a pixel, or something as physically large as pixels used to be until we got retina screens' but they can't say that as it doesn't sound technical enough!
- Raphmedia 8y agoPretty much, yes. Screens changed and evolved so now it doesn't mean much and most people will attempt to skip using them.
- Dylan16807 8y agoSo that mentions that print sets px at 96dpi. I wonder why it doesn't mention the definition of the reference pixel for high resolution devices. Which is the angle you get when you hold a 96dpi image exactly 28 inches from your eye. If your screen is 1.5x further you make the pixel 1.5x bigger, if your screen is 3x closer you make the pixel 3x smaller, etc.
- jeffhuys 8y agoWhat do you mean? 16*38=608
- chrisseaton 8y agoYeah, I can multiply correctly, thanks mate. > the default font size for most browsers is 16px I mean fonts are usually not 16 pixels in size - 16 pixels is a couple of a mm on most screens these days.
- Dylan16807 8y agoUnless you're on a phone it's more likely than not to actually be 16 pixels. Otherwise it's based on your system's GUI scaling, which varies a good bit.
- chrisseaton 8y agoRight, that's what I was saying originally. px doesn't seem to mean pixels, which is confusing. Why is anyone using pixels to layout graphical content in the first place?