The 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 Families Cascading Style Sheets (CSS) recognizes five font families: Serif Sans-serif Script Monospace Fantasy
The 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.
Cascading 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.
When 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.
Because 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:
Previous Features
~ Jennifer Kyrnin
Jennifer KyrninWeb Design / HTML Guide
Meta Refresh TagHTML Codes - Special Characters - ASCII TableTabs in HTMLspan and divHow to Build a Website
©2009 About.com, a part of The New York Times Company.
All rights reserved.