English | 简体中文 | 繁體中文 | Русский язык | Français | Español | Português | Deutsch | 日本語 | 한국어 | Italiano | بالعربية

HTML Reference Manual

Complete List of HTML Tags

HTML: <font> size attribute

This article introduces how to specify the size of the text within the <font> element using the HTML font size property, with online examples demonstrating usage, browser compatibility, syntax definition, and detailed information about its attribute values.

 HTML <font> tag

Online Example

Specify the size of the text:

!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>HTML <font> size property usage-Basic Tutorial(oldtoolbag.com)</title>
</head>
<body>
<p><font size="6">This is some text!</font></p>
<p>HTML5The color attribute is not supported, please use CSS instead.</p>
</body>
</html>
Test to see ‹/›

Browser Compatibility

IEFirefoxOperaChromeSafari

All major browsers support the size attribute.

Definition and Usage

HTML5 The <font> tag is not supported. Please use CSS instead.

In HTML 4.01 In HTML, the size attribute of <font> has been deprecated.

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

Compatibility notes

In HTML 4.01 In the <p style="font

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

CSS Example: Set the size of the text

In our CSS tutorial, you can find more aboutfont-size attribute details.

Syntax

<font size="number">

Attribute value

ValueDescription
numberspecify the size of the text. Possible values: from 1 to 7 The number. The default value of the browser is 3.
 HTML <font> tag