HTML <font> size Attribute - GeeksforGeeks

15 Dec, 2021
The HTML <font> size Attribute is used to specify the size of text which is present inside <font> element.
Syntax:
<font size="number">
Attribute Values: It contains a single value number that specifies the size of the text. The font size lies between 1 to 7. The default value of font size is 3.
Note: The <font> size attribute is not supported by HTML 5.
Example 1: This example illustrates the use of the font size property whose value ranges from 1 to 7 in HTML.
HTML
<!DOCTYPE html><html><head>    <title>HTML font size Attribute</title></head> <body>    <font size="1">GeeksforGeeks!</font><br />    <font size="2">GeeksforGeeks!</font><br />    <font size="3">GeeksforGeeks!</font><br />    <font size="4">GeeksforGeeks!</font><br />    <font size="5">GeeksforGeeks!</font><br />    <font size="6">GeeksforGeeks!</font><br />    <font size="7">GeeksforGeeks!</font></body></html>
Output:
<font> size attribute
Example 2: This example illustrates the use of the size attribute inside the <font> tag in HTML.
HTML
<!DOCTYPE html><html><head>    <title>HTML font size Attribute</title></head> <body>    <font size="7"          face="verdana"          color="green">            GeeksforGeeks!    </font>    <br>    <hr>    <font size="6"          face="arial"          color="#008000">            GeeksforGeeks!    </font>    <br>    <hr>    <font size="5"          face="sans-serif"          color="rgb(128, 128, 0)">            GeeksforGeeks!    </font>    <br>    <hr>    <font size="4"          face="times new roman"          color="#008000">            GeeksforGeeks!    </font></body></html>
Output:
<font> tag with different color, type & size attribute
Example 3: In this example, we have used the font size attribute & set it to different values in order to display similar to the use of HTML heading & paragraph.
HTML
<!DOCTYPE html><html><body>    <font size="6"          face="sans-serif"          color="green">              GeeksforGeeks    </font>    <br>    <hr>    <font size="3"          face="Comic sans MS">       Learn Data Structures Online At Your Own Pace With       The Best Of Faculty In The Industry. The Best       Data Structures Course Available Online From       Skilled And Experienced Faculty.    </font></body></html>
Output:
<font> tag with different face & size attribute
Supported Browsers:
Google Chrome 93.0
Internet Explorer 11.0
Microsoft Edge 93.0
Firefox 92.0
Safari 14.1
Opera 79.0
Attention reader! Don’t stop learning now. Get hold of all the important HTML concepts with the Web Design for Beginners | HTML  course.
bhaskargeeksforgeeks
HTML-Attributes
HTML
Web Technologies
HTML
Writing code in comment?
Please use ide.geeksforgeeks.org,
generate link and share the link here.
REST API (Introduction)
How to Insert Form Data into Database using PHP ?
Types of CSS (Cascading Style Sheet)
HTML | <img> align Attribute
How to position a div at the bottom of its container using CSS?
Remove elements from a JavaScript Array
Installation of Node.js on Linux
Convert a string to an integer in JavaScript
How to fetch data from an API in ReactJS ?
Difference between var, let and const keywords in JavaScript