What does having more than one font in CSS mean?

font:0.5em Georgia,"Times New Roman",Sans-Serif; 

What does it mean when someone installs 3 different fonts? Also what does em mean?

Update: Are there double quotes around Times New Roman that it says CSS to use this in the first place?

+4
source share
5 answers

Several fonts indicate the order of preference in the fonts to use. In this case, the preferred font is Georgia ; if this is not possible, use Times New Roman and finally return to Sans-Serif .

em is a relative measure of font size , so in this case it means that half of the "normal" font size is used.

+8
source

Failover. If you do not have the first, she tries the second, etc.

+2
source

Yes. The first installed font is used, so in your case, the Georgia font is used if it is installed. If not, use Times New Roman. If none of them are installed, the Sans-Serif font will be used. (Yes, Sans-Serif is not the name of a particular font, but the name of a family of similar fonts, without the so-called serifs .)

When it comes to the "em" unit, see W3C Schools .

+1
source

Alternatives to the font are not installed in the system (if there is no Georgia, go to Times New Roman, ..).

Em is a CSS unit of measure ( http://www.w3schools.com/css/css_units.asp ). It is equal to the size of the text (for example, the default browser, depending on the context).

+1
source

If the font name contains a space, it must be specified. Single quotes should be used when using the HTML style attribute

+1
source

Source: https://habr.com/ru/post/1308569/


All Articles