| You are here: | About>Computing & Technology>Web Design / HTML> About.com Web Design A to Z> Web Design Articles R-Z> Web Design/HTML Articles W> Learn how to Use Fonts with Cascading Style Sheets (CSS) |
![]() | Web Design / HTML |
![]() Examples of Typefaces Jennifer Kyrnin Web Design PathDefinitionsWhat is a Font?Understanding Fonts is Key to Using CSSThe most common way that Cascading Style Sheets are used is to change the font of a Web page or site. But in order to get the most out of the style sheets as well as the fonts, you should know a little about typography and how CSS works with fonts. The Font FamiliesCascading Style Sheets (CSS) recognizes five font families: These categories or master families are considered generic families because they do not refer to any specific typeface. If you use these cateogory names in your CSS, the browser will choose the typeface that is the default for that category on that computer. Each category has many different typefaces that are a part of the family. I've put up a graphic to show examples of the different typefaces for each category. Using the CategoriesWhen you're going to build a CSS call to define the typeface of your elements, you should keep the above categories in mind. They are each suited to different uses, and it's better not to mix them in a style call.
Building Your CSSBecause it's impossible to know the exact setup of every person who visits your Web page, it is very important to write CSS that is flexible, but still presents the basis of the design you want. This means, that when defining the typeface to display, always use a list of fonts, with your preference first, and the most generic last. Define the typeface using the font-family style property. Some possible style listings:
Some Things to Note:
Web Design PathDefinitions |
Las Vegas on a BudgetFind a BargainHotel DealsCheap EatsFree AttractionsEntertainment for Less |
All Topics | Email Article | | | ![]() |
| Advertising Info | News & Events | Work at About | SiteMap | Reprints | Help | Our Story | Be a Guide |
| User Agreement | Ethics Policy | Patent Info. | Privacy Policy | ©2008 About, Inc., A part of The New York Times Company. All rights reserved. |



