HTML <font> Tag
The font element is deprecated.
Example
Specify the font size, font face and color of text:
<font size="3" color="red">This is some text!</font>
<font size="2" color="blue">This is some text!</font>
<font face="verdana" color="green">This is some text!</font> |
Try it yourself » |
Definition and Usage
The <font> tag specifies the font face, font size, and font color of text.
Browser Support

The <font> tag is supported in all major browsers.
Differences Between HTML and XHTML
The font element was deprecated in HTML 4.01, and is not supported in XHTML 1.0 Strict DTD.
Tips and Notes
Tip: Use CSS to define the font face, font size, and font color of text.
Optional Attributes
DTD indicates in which DTD the attribute is allowed. S=Strict, T=Transitional, and F=Frameset.
| Attribute |
Value |
Description |
DTD |
| color |
rgb(x,x,x)
#xxxxxx
colorname |
Deprecated. Use styles instead.
Specifies the color of text |
TF |
| face |
font_family |
Deprecated. Use styles instead.
Specifies the font of text |
TF |
| size |
number |
Deprecated. Use styles instead.
Specifies the size of text |
TF |
Standard Attributes
The <font> tag supports the following standard attributes:
| Attribute |
Value |
Description |
DTD |
| class |
classname |
Specifies a classname for an element |
STF |
| dir |
rtl
ltr |
Specifies the text direction
for the content in an element |
STF |
| id |
id |
Specifies a unique id for an element |
STF |
| lang |
language_code |
Specifies a language code for the content in an element |
STF |
| style |
style_definition |
Specifies an inline style for an element |
STF |
| title |
text |
Specifies extra information about an element |
STF |
More information about Standard Attributes.
Event Attributes
The <font> tag does not support any event attributes.
More information about Event Attributes.

Whether you're new to XML or already an advanced user,
the user-friendly views and powerful entry helpers,
wizards, and debuggers in XMLSpy are designed to meet your XML
and Web development needs from start to finish.
- XML editor
- Graphical XML Schema / DTD editors
- XSLT 1.0/2.0 editor, debugger, profiler
- XQuery editor, debugger, profiler
- XBRL validator & taxonomy editor
- Support for Office Open XML (OOXML)
- Graphical WSDL editor & SOAP debugger
- Java, C#, C++ code generation
- And much more!
Download a free trial today!
|
|
|
|