Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What does having more than 1 font in CSS mean?

Tags:

css

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

What does this mean when someone sets 3 different fonts? Also what is the em mean?

Update: Does the double quotations around Times New Roman mean it is telling CSS to use this first?

like image 977
Strawberry Avatar asked Dec 12 '22 22:12

Strawberry


2 Answers

Multiple fonts indicate an order of preference in fonts to use. In this case, Georgia is the preferred font; if that's not available, use Times New Roman, and finally fall back to Sans-Serif.

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

like image 98
Mark Rushakoff Avatar answered Dec 25 '22 14:12

Mark Rushakoff


Failover. If you dont have the first one, it tries the second, and so on.

like image 31
Mitch Dempsey Avatar answered Dec 25 '22 13:12

Mitch Dempsey