Webpage Workshop: Home » HTML language reference » Base font

Base font (transitional only)

This element is used to set the font in which page should be rendered. It is only part of the transitional document type as font settings have been deprected in favor of style sheets.

<basefont
    color="color name | #RRGGBB"**
    face="font name(s)"**
    id="unique identifier"**
    size="1-7 | +/-integer"**
>

Key:
‡ = Required attribute
** = Transitional only

Explanation of attributes

color**: used to specify the color that the element should be rendered in. This typically uses a color name or a color code.

face**: used to specify the font face. This is a list of fonts separated by commas; the first font in the list is the recommended one, with the other fonts being alternatives if the primary font is not available on the client.

id**: used to specify a unique alphanumeric identifier to the element. This is usually used in combination with stylesheets in order to apply a style to one particular instance of an element. Only one element, regardless of type, can be given a particular id.

size**‡: used to specify the default font size for the page. Valid sizes are from 1 to 7. The standard size of a font is defined as 4. Sizes can also be defined as +/- in relation to the standard size.

Event handlers

No event handlers are defined for this element.

Basic example

<basefont color="#0000ff"
    face="arial,helvetica,sans-serif"
    size="3">

In the above code, the font color is set to blue with the font face set to arial (or if not available, helvetica or a sans-serif font). The font size was also set to 3.

Compatibility

Description: Support of base font and attributes in various browsers
Test Internet Explorer 6+ Netscape 4 Mozilla and Netscape 6+ Opera 6+ MSN TV (WebTV) Konqeuror 3.0+
Basic element support  Yes  Yes  No  Yes  Yes 
Attribute: color  Yes  No  No  No  No 
Attribute: face  Yes  No  No  No  No 
Attribute: id  Yes  Yes  No  Yes  No 
Attribute: size  Yes  Yes  No  Yes  No 

Key:
The browser icons are explained in the below list:
Internet Explorer 6+ = Microsoft Internet Explorer 6+
Netscape 4 = Netscape Communicator 4
Mozilla and Netscape 6+ = Mozilla and Netscape Navigator 6+
Opera 7+ = Opera 7+
MSN TV (WebTV) = MSN TV (aka. WebTV)
Konqeuror 3.0+ = Konqueror 3.0+