网络学院 w3pop社区 网络资源 IT新闻

w3pop.com :: 网络学院 :: HTML :: HTML <font>标签

会员登陆

帐号

密码

回答

记住密码

忘记密码? 注册

HTML <font>标签


作者:w3pop.com 翻译/整理:w3pop.com 发布:2007-04-28 浏览:2378 :: ::

定义与使用

The <font> tag specifies the font face, font size, and font color of text.
<font>标签可以指定文字的字体,大小以及颜色。


它在HTML和XHTML中的区别

The font element was deprecated in HTML 4.01.
font元素在HTML4.01中不推荐使用

The font element is not supported in XHTML 1.0 Strict DTD.
在XHTML1.0严密型DTD中不再支持font元素


提示与注意点

Tip: Use styles (instead of the <font> tag) to define the font face, font size, and font color of text.
提示:请使用样式来代替<font>标签。


实例

代码 输出结果
<font size="3" color="red">
This is some text!
</font>
<font size="1" color="blue">
This is some text!
</font>
<font face="arial" color="red">
This is some text!
</font>
This is some text! This is some text! This is some text!


可选属性

DTD indicates in which DTD the attribute is allowed. S=Strict, T=Transitional, and F=Frameset.
下表中的DTD列指明了被支持的DTD属性。S=Strict(精确的),T=Transitional(传统的),F=Frameset(框架)

属性 描述 DTD
color rgb(x,x,x)
#xxxxxx
colorname
Defines the color of the text in the font element. Deprecated. Use styles instead
定义font元素中文字的颜色。不推荐。使用样式来做替代
TF
face list_of_fontnames Defines the font of the text in the font element. Deprecated. Use styles instead
定义font元素中文字的字体。不推荐。使用样式来做替代
TF
size A number from 1 to 7.
If basefont is specified you can specify a number from -6 to 6
Defines the size of the text in the font element. Deprecated. Use styles instead
定义font元素中的文字大小。不推荐。使用样式来做替代
TF

标准属性

id, class, title, style, dir, lang, xml:lang

For a full description, go to Standard Attributes.
查看完整的描述

事件属性

NONE


尝试与演示

Using the font element
How to use the font element.
怎样使用font元素

评论 (0) All