Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Font size medium in css

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?

like image 437
Sowmya Avatar asked May 29 '12 08:05

Sowmya


2 Answers

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.

like image 63
Quentin Avatar answered Sep 28 '22 08:09

Quentin


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?

like image 42
shauneba Avatar answered Sep 28 '22 09:09

shauneba