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
| Test | ![]() |
![]() |
![]() |
![]() |
![]() |
![]() |
|---|---|---|---|---|---|---|
| Basic element support | |
|
|
|
|
? |
| Attribute: color | |
|
|
|
|
? |
| Attribute: face | |
|
|
|
|
? |
| Attribute: id | |
|
|
|
|
? |
| Attribute: size | |
|
|
|
|
? |
Key:
The browser icons are explained in the below list:
= Microsoft Internet Explorer 6+
= Netscape Communicator 4
= Mozilla and Netscape Navigator 6+
= Opera 7+
= MSN TV (aka. WebTV)
= Konqueror 3.0+