This webpage is updated by Len Hom on May 1, 1999
Len's Stylesheet 3 - Controlling the Font Using Linked CSS and Inline
Style Markup
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, cursive, sans-serif; }
H1,H2 { font-family: Times New Roman, cursive, sans-serif; }
- In this example, H1 headings are shown preferably in red Arial font ,
then cursive, and defaults to sans-serif on the linked style sheet; but for the inline
style markup, the font color is given as blue as shown on the browser.
- H2 headings would appear in blue Arial font, then cursive, and defaults to
sans-serif font on the linked style sheet; however, the inline style markup shows
red font color, which is what is shown on the browser.
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 % }
- This example sets heading sizes in percentages relative to the size used for normal text.
- Font sizes may be set using pixels and points units as given below.
- Font sizes may also be set using descriptive means as shown below.
Heading set at 30 pixels
Heading set at 30 points
Heading set at medium font size
Heading set at extra small font size
If you have any comments or questions, please send email to:
Len Hom
Back
Next
Return to Beginning of Page
I take full responsibility
for the information posted. The information on this page
represents that of myself and not that of
California State University,
Sacramento or the School of
Engineering and Computer Science