HTML <font> faceAttribute

HTML font 标签参考手册HTML <font> Tag

Examples

Defines the font of the text:

<font face="verdana">This is some text!</font>

Try it Yourself »

Browser Support

Internet ExplorerFirefoxOperaGoogle ChromeSafari

All major browsers support the face attribute.


Definition and Usage

HTML5 does not support the <font> tag. Please use CSS instead.

In HTML 4.01, the face attribute of <font>is deprecated.。

The face attribute specifies the font of the text within the <font> element.

Tip:The face attribute can hold several font names as fallbacks. Put the font you prefer first in the font list, and if the first font is unavailable, use the subsequent fallback fonts. You should put a generic font last (serif, sans-serif, monospace, cursive, or fantasy) so that if none of the previously listed fonts are available, the browser can find a matching font in the generic font library.


Compatibility Notes

In HTML 4.01, the face attribute of <font> is deprecated. Please use CSS instead.

CSS Syntax: <p style="font-family: verdana">

CSS Example: Set the font of text

In our CSS tutorial, you can find more details aboutthe font-family propertythe details.


Syntax

<font face="font_family">

Attribute Values

Value Description
font_family Specifies the font of the text. To specify a priority list of several fonts, use comma-separated font names (for example, <font face="verdana,arial,sans-serif">).


HTML font 标签参考手册HTML <font> Tag Other Extensions