Font-family part 2

CSS Fundamentals
Working with Text
font-family
28
2/2
         

The font-family Property



The font-family property should hold several font names as a "fallback" system. When specifying a web font in a CSS style, add more than one font name, in order to avoid unexpected behaviors. If the client computer for some reason doesn't have the one you choose, it will try the next one. 

It is a good practice to specify a generic font family, to let the browser pick a similar font in the generic family, if no other fonts are available.body {
font-family: Arial, "Helvetica Neue", Helvetica, sans-serif;
}

If the browser does not support the font Arial, it tries the next fonts (Helvetica Neue, then Helvetica). If the browser doesn't have any of them, it will try the generic sans-serif
Remember to use quotation marks if the font name consists of more than one word.

Comments

Popular posts from this blog

font-family part 1