<font>

Deprecated: This feature is no longer recommended. Though some browsers might still support it, it may have already been removed from the relevant web standards, may be in the process of being dropped, or may only be kept for compatibility purposes. Avoid using it, and update existing code if possible; see the compatibility table at the bottom of this page to guide your decision. Be aware that this feature may cease to work at any time.

<font> HTML 元素定义其内容的字体大小、颜色和外观。

¥The <font> HTML element defines the font size, color and face for its content.

警告:不要使用该元素。使用 CSS 字体 属性设置文本样式。

¥Warning: Do not use this element. Use the CSS Fonts properties to style text.

属性

¥Attributes

与所有其他 HTML 元素一样,此元素支持 全局属性

¥Like all other HTML elements, this element supports the global attributes.

color Deprecated

此属性使用命名颜色或以十六进制 #RRGGBB 格式指定的颜色来设置文本颜色。

face Deprecated

该属性包含一个或多个字体名称的逗号分隔列表。默认样式的文档文本以客户端浏览器支持的第一个字体呈现。如果本地系统上未安装列出的字体,则浏览器通常默认为该系统的比例或固定宽度字体。

size Deprecated

该属性将字体大小指定为数字或相对值。数值范围从 17,其中 1 是最小的,3 是默认值。它可以使用相对值来定义,例如 +2-3,这将其设置为相对于默认值 3

DOM 接口

¥DOM interface

该元素实现 HTMLFontElement 接口。

¥This element implements the HTMLFontElement interface.

规范

Specification
HTML Standard
# font

¥Specifications

浏览器兼容性

BCD tables only load in the browser

¥Browser compatibility