How does the font-size
medium/small/large work in css? If the css has a font-size:11px
, then what is the font-size:medium
for other elements, does it depend on the font size, or is it unrelated to font size?
From the specification:
An <absolute-size> keyword is an index to a table of font sizes computed and kept by the UA.
and
The 'medium' value is the user's preferred font size and is used as the reference middle value.
So it doesn't depend on the body font-size.
I believe it's based on the user's preferred font size in their browser, which is probably set to 11 or 12.
See here too for more info Does the CSS 'font-size: medium' set font to .Body font size or to the *browser*'s base font size?
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With