Next Previous Contents HTML 4.0 compliance checked by http://validator.w3.org

15.2 Fonts and Physical Styles

Section 15 contains mostly deprecated tags. As a test of the deprecated BGCOLOR attribute on the BODY tag (sect. 15.1.1), the background of this document should be yellow.

Text alignment is illustrated in the paragraph test.

Floating objects (sect. 15.1.3) are thoroughly tested in the CSS style sheet test suite, so the deprecated ALIGN= attribute for images and tables won't be tested here. <BR CLEAR=...> is also tested with the style sheets and isn't tested here.

15.2.1: Here is a medley of inline physical font styles. It's recommended to use semantic phrase elements instead, but most of these are not actually deprecated. TT for monospace (typewriter) font. <I> for italic font. B for bold font. BIG for a bigger font than the default. SMALL for a smaller font than the default. STRIKE or S for strikeout font (deprecated). U for underlined text (deprecated).

Here are the same styles as a list.

Small-caps and text transformations are properly style sheet effects, but being related to physical phrase styles, they're illustrated here. Each item has a different effect on the whole sentence. Each word is capitalized (except the capitalize demo) and a random section (not coherent with word boundaries) is italic to reveal if inheritance works properly and if there are any baleful interactions with element boundaries.

The FONT and BASEFONT tags are deprecated. BASEFONT is empty and sets the default font size (initially 3), while FONT contains text. Here is a list of absolute font sizes, set by FONT. User agents may not have distinct sizes for all seven grades.

  1. Size 1
  2. Size 2
  3. Size 3
  4. Size 4
  5. Size 5
  6. Size 6
  7. Size 7

These are relative font sizes as set by FONT; the base size is the default, 3. They should come out the same as the ones above.

  1. Size -2
  2. Size -1
  3. Size +0
  4. Size +1
  5. Size +2
  6. Size +3
  7. Size +4

Here is a test of the five generic fonts defined in HTML 4.0, followed by a nonexistent font and several font choice lists, the latter indicated by style effects. Check that each glyph is readable. In particular, specialized fonts sometimes have screwy encodings for punctuation causing the apostrophe to come out wrong.

Serif
The quick brown fox jumped over the lazy dog's back. 0123456789.
Sans-Serif
The quick brown fox jumped over the lazy dog's back. 0123456789.
Cursive
The quick brown fox jumped over the lazy dog's back. 0123456789.
Monospace
The quick brown fox jumped over the lazy dog's back. 0123456789.
Fantasy
The quick brown fox jumped over the lazy dog's back. 0123456789.
Fantasy (size 7)
The quick brown fox jumped over the lazy dog's back. 0123456789.
Nonexistent (should pick some existing font)
The quick brown fox jumped over the lazy dog's back. 0123456789.
Serif (color blue)
The quick brown fox jumped over the lazy dog's back. 0123456789.
Sans-Serif, Serif (should show as Sans)
The quick brown fox jumped over the lazy dog's back. 0123456789.
Nonexistent, Sans-Serif, Serif (should show as Sans)
The quick brown fox jumped over the lazy dog's back. 0123456789.

There follows a BASEFONT element selecting maroon Helvetica in size 4, and another range of relative fonts.

  1. Size -2
  2. Size -1
  3. Size +0
  4. Size +1
  5. Size +2
  6. Size +3
  7. Size +4 (too big, should get size 7, not 8).

Rules (horizontal lines, sect. 15.3) are found in the paragraph test.


Next Previous Contents