Little Web Hut

HTML 4.01 and XHTML 1.0 Reference: <font> Tag

This element has been deprecated.
HTML <font> Tag - Font Size, Color, and Typeface
Syntax This element uses separate opening and closing tags.
<font>...</font>
Usage The <font> tag is used to specify the text font size, color and font name. The text is placed between the opening and closing font tags.

HTML & XHTML <font> tag example using sRGB color value.
<font size="4" color="#FF0000" face="Courier New, Courier, monospace">
 This text has the size, color, and font specified with the font tag.
</font>
Test It HTML StyleTest It XHTML Style

Content Model The <font> element can contain the following tags, and Text, between its opening and closing tags.Notes:
1. The <font> element can contain the <iframe> tag when using DTD Transitional and Frameset documents but not Strict documents.
2. Red tags have been deprecated and are allowed in DTD Transitional and Frameset documents but not Strict documents.

Red attributes have been deprecated
<font> Tag Attribute Summary
Required Tag Specific Core Focus Events Language
  color face size id class style title     dir lang xml:lang1
Notes: 1. XHTML only.

Red attributes have been deprecated
<font> Tag Attributes
Attribute Description
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 & XHTML <font> tag example using sRGB color value.
<font size="4" color="#FF0000" face="Courier New, Courier, monospace">
 This text has the size, color, and font specified with the font tag.
</font>
Test It HTML StyleTest It XHTML Style

HTML & XHTML <font> tag example using color name value.
<font size="4" color="green" face="Courier New, Courier, monospace">
 This text has the size, color, and font specified with the font tag.
</font>
Test It HTML StyleTest 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 & XHTML <font> tag example using sRGB color value.
<font size="4" color="#FF0000" face="Courier New, Courier, monospace">
 This text has the size, color, and font specified with the font tag.
</font>
Test It HTML StyleTest It XHTML Style


Note: This attribute has been deprecated.
sizeThe size attribute is used to specify the text font size using an integer value between 1 and 7.

HTML & XHTML <font> tag example using sRGB color value.
<font size="4" color="#FF0000" face="Courier New, Courier, monospace">
 This text has the size, color, and font specified with the font tag.
</font>
Test It HTML StyleTest 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
classThe class attribute assigns a class name to a tag. The class name does not need to be unique. More than one tag can have the same class name. This allows style sheets or scripts to reference multiple tags with a single class name. See class Example
styleThe style attribute specifies styles for the tag. For Cascading Style Sheets (CSS), the syntax is name:value. Each name:value pair is separated by semicolons. See style Example
titleThe title attribute specifies additional information about the tag. It is common for browsers to display the title when the pointing device stops over the object. See title Example
dirThe dir attribute tells the browser whether the text should be displayed from left-to-right or right-to-left. It does not reverse the direction of the characters, like the <bdo> tag does, but it can help the browser to determine if the text should be aligned on the left side or the right side. See dir Example
langThe lang attribute specifies a language. This attribute can help the browser to correctly display text. This attribute can also be useful for braille translation software, speech synthesizers, dictionary definitions, etc. See lang Example
xml:langThe xml:lang attribute specifies a language for XHTML documents. This attribute can help the browser to correctly display text. This attribute can also be useful for braille translation software, speech synthesizers, dictionary definitions, etc. See xml:lang Example

Note: XHTML only.

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