3 ms·
You just expanded on my poorly worded question :) so, yes, it is still all based on a "base pixel value, that is not really a pixel".
by lisrjflksdjfi 3y ago
You just expanded on my poorly worded question :)
so, yes, it is still all based on a "base pixel value, that is not really a pixel".
- chrismorgan 3y agoOnly partly, and not the part that dtagames was speaking of. There are three families of distance units. One is absolute length units <https://www.w3.org/TR/css-values-4/#absolute-lengths https://www.w3.org/TR/css-values-4/#absolute-lengths>. px is the canonical one of these, but it may be anchored to physical measurements (typical in print) or the reference pixel (which in practice is generally approximated by some number of device pixels multiplied by a scaling factor from the operating system). Then you get viewport-percentage lengths <https://www.w3.org/TR/css-values-4/#viewport-relative-lengths https://www.w3.org/TR/css-values-4/#viewport-relative-length...>, of which I will not speak, save to note that they’re broken by design so that they’re almost completely useless for layout purposes. Then you get font-relative lengths <https://www.w3.org/TR/css-values-4/#font-relative-lengths https://www.w3.org/TR/css-values-4/#font-relative-lengths>. The em dtagames speaks of is one of these. The root em, rem, is commonly used as a base, and is most commonly 16px, but it depends on a variety of factors like user preferences, the root font-size, the root font-family, and the root language. It’s very messy and even mildly context-dependent. Most lengths should generally be font-relative for most perfect compatibility and user-preference-acceptance, but doing this perfectly is harder than it may sound.