This webpage is updated by Len Hom on March 6, 1999
Len's Style Sheet 3 - Controlling the Font
Font Family
- Not all fonts are available on all browsers.
- To specify fonts, you are allowed to list several fonts in
preferential order.
- There is a short list of generic fonts that are available
in most browsers, so you should end your list with one of these:
serif, sans-serif, cursive, fantasy, or monospace, i.e.
BODY { font-family: Arial, sans-serif; }
H1,H2 { font-family: Times New Roman, sans-serif; }
- In this example, important headings are shown preferably in Times New Roman font, and
defaults to sans-serif.
- Paragraph text would appear in Arial font, and defaults also to sans-serif font.
Setting the Font Size
Most browsers have default sizes for the headings. If you overide the default size, you may
run the risk of making the text too small to be legible. You can specify font sizes in relative
terms, i.e.
H1 { font-size: 300 % }
H2 { font-size: 200 % }
H3 { font-size: 150 % }