This is the P2PU Archive. If you want the current site, go to www.p2pu.org!

Designers Tackling the Web

My recent threads

You haven't posted any discussions yet.

Recently updated threads

font family

Go back to: General discussion

Hi there!
I am trying to do CSS in plain text.

How does "font family" work? Example: font-family:"Times New Roman",Georgia,Serif;...Are we supposed to have one font for a paragraph? How does these multiple fonts work for one paragraph or a title. Thanks a lot!

Diedie

tapesofwrath's picture
tapesofwrath
Wed, 2010-10-06 15:34

If you mean why use multiple values like that, that's to ensure that your users will have at least one of the fonts that you pick. For instance, the browser will first look for Times New Roman on the users system. If they have it installed, it will use that one. But, if not it will move on to the next font in your "stack". The last one is a generic font family. "Serif" means if none of the fonts on the list are installed, the browser will still render the element in whatever default serif font the user does have.

This is helpful to get around the fact that different fonts are common on different operating systems (Windows, Mac, and Linux all ship with slightly different fonts). If you search for "font stack", you'll find some lists of the most popular fonts on various operating systems and font stacks that people have put together for maximum compatibility.

Austin King's picture
Austin King
Wed, 2010-10-06 15:59

You only have to use quotation marks around fonts with spaces in the name like "Times New Roman".