HTML font face Attribute
HTML <font> tag
Definition and Usage
The face attribute specifies the font of the content within the font
element.
Compatibility Notes
The font element was deprecated in HTML 4.01
and is not supported in XHTML 1.0 Strict DTD.
Use CSS instead.
CSS syntax: <p style="font-family: courier, serif">
In our CSS tutorial you can find more details about the
font-family property.
Syntax
<font face="font-family">
|
Syntax Example
<font face="Arial, Times New Roman">
|
Attribute Values
Value |
Description |
font-family |
Specifies the font for
the text/elements within the font element. Default value: Browser dependent
Possible values: A comma separated prioritized list of font family names
to use.
There are two types of font-family values:
- family-name: The name of a font-family, like "times",
"courier", "arial", etc
- generic-family: The name of a generic-family, like "serif",
"sans-serif", "cursive", "fantasy", "monospace"
|
Browser Support
The attribute is deprecated, but still supported in all major browsers.
Example
Source |
Output |
<font face="Arial, Times New Roman">
<p>Welcome to W3Schools</p>
</font> |
Welcome to W3Schools
|
Try-It-Yourself Demos
font face
attribute example
Set the font of a group of elements with the font face attribute.
In CSS:
font family example
Set the font of a single, and a group of elements with CSS.
HTML <font> tag
|
|
|