Latest web development tutorials

HTML <font> tag

Examples

The provisions of the text size, font and color:

<font size="3" color="red">这是一些文本!</font>
<font size="2" color="blue">这是一些文本!</font>
<font face="verdana" color="green">这是一些文本!</font>

try it"

Browser Support

Internet ExplorerFirefoxOperaGoogle ChromeSafari

All major browsers support the <font> tag.


Tag definitions and instructions

HTML5 does not support the <font> tag. Please be replaced with CSS.

In HTML 4.01, <font> element is obsolete .

<Font> tag specified text font, font size, font color.


Tips and Notes

Tip: Use CSS to define the text font, size, color .


Differences between HTML 4.01 and HTML5

HTML5 does not support the <font> tag, HTML 4.01 obsolete <center> tag.


Optional attributes

属性 描述
color rgb(x,x,x)
#xxxxxx
colorname
HTML5 不支持。HTML 4.01 已废弃。 规定文本的颜色。
face font_family HTML5 不支持。HTML 4.01 已废弃。 规定文本的字体。
size number HTML5 不支持。HTML 4.01 已废弃。 规定文本的尺寸。


Standard property

In HTML 4.01, <font> tag supports the following standard attributes:

属性 描述
class classname 规定元素的类名
dir rtl
ltr
规定元素中内容的文本方向
id id 规定元素的唯一 id
lang language_code 规定元素中内容的语言代码
style style_definition 规定元素的行内样式
title text 规定元素的额外信息

For a full description, go to Standard property .


Event Properties

In HTML 4.01, <font> tag does not support any event attributes.

For a full description, go to Event Attributes .