Name

basefont

Synopsis

    <basefont>

This element is deprecated.

Attributes

id=" text "

Deprecated attributes

color="#RRGGBB" or "color name"
face="typeface" (or list of typefaces)
size=" value "

The font element adds no semantic value to a document and mixes presentation instructions in with the document structure. Furthermore, it makes updating a site more labor intensive, because each and every font element needs to be hunted down and changed, unlike style sheets that enable elements throughout a site to be reformatted with one simple edit.

The font element has three attributes, all of which have been deprecated as well:

color

Specifies the color of the text using a hexadecimal RGB value or color name.

face

Specifies a font or list of fonts (separated by commas) to be used to display the element.

size

Specifies the size for the font. The default text size is represented by the value “3.” Values may be provided as numbers (1 through 7) or as values relative to 3 (for example, the value -1 is the same as the value 2, the value +3 is the same as 6).

A single font element may contain all of these attributes as shown:

    <font face="sans-serif" size="+1" color="white"><em>...</em></font>

All of the functionality of the font element has been replaced by style sheet properties. The font element in the example could be handled with these style properties:

    em {font-family: sans-serif;
        font-size: 120%;
        color: white; }

For more information on using style sheets to control the presentation of fonts, see ...

Get Web Design in a Nutshell, 3rd Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.