Little Web Hut

HTML 4.01 and XHTML 1.0 Reference: <basefont> Tag

This element has been deprecated.
HTML <basefont> Tag - Base Font Size, Color, and Typeface
Syntax HTML syntax - This element does not require a closing tag.
<basefont>

XHTML syntax - This element is opened and closed, within a single tag, by adding a space followed by a forward slash at the end of the tag.
<basefont />
Usage The <basefont> tag is used to specify the text font size, and optionally the color and font name. The <basefont> applies to the text that follows it. This tag is not supported by some browsers.

HTML <basefont> tag example using sRGB color value.
<basefont size="4" color="#FF0000" face="Courier New, Courier, monospace">
Test It HTML Style

XHTML <basefont> tag example using sRGB color value.
<basefont size="4" color="#FF0000" face="Courier New, Courier, monospace" />
Test It XHTML Style

Content Model The <basefont> element cannot contain any tags.

Red attributes have been deprecated
<basefont> Tag Attribute Summary
Required Tag Specific Core Focus Events Language
size color face id      

Red attributes have been deprecated
<basefont> Tag Attributes
Attribute Description
sizeThe size attribute is used to specify the text font size using an integer value between 1 and 7.

HTML <basefont> tag example using the size attribute.
<basefont size="4" color="#FF0000" face="Courier New, Courier, monospace">
Test It HTML Style

XHTML <basefont> tag example using the size attribute.
<basefont size="4" color="#FF0000" face="Courier New, Courier, monospace" />
Test It XHTML Style


Note: This is a required attribute.
Note: This attribute has been deprecated.
colorThe color attribute is used to specify the color of the text. The color value can be expressed as an sRGB value which is a hash (#) symbol followed by a hexadecimal value. Or, the color value can be expressed as a color name. Color names are black, silver, gray, white, maroon, red, purple, fuchsia, green, lime, olive, yellow, navy, blue, teal, or aqua.

HTML <basefont> tag example using sRGB color value.
<basefont size="4" color="#FF0000" face="Courier New, Courier, monospace">
Test It HTML Style

XHTML <basefont> tag example using sRGB color value.
<basefont size="4" color="#FF0000" face="Courier New, Courier, monospace" />
Test It XHTML Style

HTML <basefont> tag example using color name value.
<basefont size="4" color="green" face="Courier New, Courier, monospace">
Test It HTML Style

XHTML <basefont> tag example using color name value.
<basefont size="4" color="green" face="Courier New, Courier, monospace" />
Test It XHTML Style


Note: This attribute has been deprecated.
faceThe face attribute is used to specify the font family by using a comma separated list of font names.

HTML <basefont> tag example using the face attribute.
<basefont size="4" color="#FF0000" face="Courier New, Courier, monospace">
Test It HTML Style

XHTML <basefont> tag example using the face attribute.
<basefont size="4" color="#FF0000" face="Courier New, Courier, monospace" />
Test It XHTML Style


Note: This attribute has been deprecated.
idThe id attribute assigns a unique name to a tag. This allows style sheets or scripts to reference the tag. See id Example

HTML <basefont> Tag Examples
Test It HTML StyleTest It HTML Style<basefont> tag example using sRGB color value.
Test It HTML StyleTest It HTML Style<basefont> tag example using color name value.