HTML <font> sizeAttribute

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

Examples

Specifies the size of text:

<font size="6">This is some text!</font>

Try it Yourself »

Browser Support

Internet ExplorerFirefoxOperaGoogle ChromeSafari

All major browsers support the size attribute.


Definition and Usage

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

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

The size attribute specifies the size of the text in the <font> element.


Compatibility Notes

In HTML 4.01, the size attribute of <font> is deprecated. Use CSS instead.

CSS syntax: <p style="font-size:20px">

CSS Example: Set the size of text

In our CSS tutorial, you can find more details aboutthe font-size property.


Syntax

<font size="number">

Attribute Values

Value Description
number Specifies the size of the text. Possible values: numbers from 1 to 7. The browser default value is 3.


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