 Rank: Administration Groups: Administration
Joined: 11/23/2008 Posts: 335 Points: 711 Location: Australia
|
Font Categories There are so many font typefaces. But we only need to look at 5 font categories that Cascading Style Sheets (CSS) recognises: Sans-serif Serif Monospace Fantasy Script
Each category contains many different typefaces that are a part of the family. If you use these category names in your CSS, the browser will choose the typeface that is the default for that category on that computer.
Because each family suits for a different use, it's better not to mix them in a style call. Sans-serif fonts should be the basis of your web content because they are easy to read on screen.
Serif fonts are best used in print style sheets because serif fonts make printouts easier to read.
Monospace fonts are commonly used to display code, pre-formatted text or other technical details.
Fantasy fonts are best used for headings and artistic text. Note that you might need to have a sans-serif alternate in your font list because the Fantasy font might not be available on the reader's computer system.
Script fonts give the look of cursive handwriting. It's commonly used as signatures. Note that you might need to have a sans-serif alternate in your font list because the Script font might not be available on the reader's computer system.
Font Families in CSS Because you don't know whether a font is available on readers' computer system, in order to present the basis of the design you want, you need to define a list fonts in the family, with your preference first, and the most generic last. See the following example style listings:
sans-serif body { font-family : Verdana, Geneva , Arial, Helvetica, sans-serif; }
serif for print body { font-family : "Times New Roman", Times, serif; }
monospace for code segments code { font-family : "Courier New", Courier, monospace; }
fantasy for initial paragraph lettering (default to sans-serif if my fantasy font isn't available) p:first-letter { "Comic Sans", sans-serif } script for signature sections address { Corsiva, "Lucida Handwriting", script;
Some examples of sans-serif fonts are: Arial Geneva Helvetica Lucida Sans Trebuchet Verdana
Verdana is a font family that was actually invented for use on the Web.
Basic Rules
Always define font families before size, typeface or other type options. Always define your preferred font first in the list. If a font name contains multiple words, put it in quotes.
|