HTML Font Size

The Size is an attribute of <font> tag, which specifies the text size.

Syntax

<font size="number">  

In the above syntax, the number is a value of the Size attribute, which denotes the text size. The number for the font size is lies between the 1 and 7. By default, the font size of a text on a web page is 3.

Note: The size attribute of <font> tag is not supported in HTML5. We can use CSS instead of it.

Example 1: The following example uses the different numbers from 1 to 7 as the size of a text:

<!DOCTYPE html>  

<html>  

<title>  

Example of Size attribute  

</title>  

<body>  

<Center>   

<font size="1">   

JavaTpoint Size = "1"  

</font>  

<br>  

<font size="2">   

JavaTpoint Size = "2"  

</font>  

<br>  

<font size="3">   

JavaTpoint Size = "3"  

</font>  

<br>  

<font size="4">   

JavaTpoint Size = "4"  

</font>  

<br>  

<font size="5">   

JavaTpoint Size = "5"  

</font>  

<br>  

<font size="6">   

JavaTpoint Size = "6"  

</font>  

<br>  

<font size="7">  

JavaTpoint Size = "7"  

</font>  

</Center>  

</body>  

</html>

Output:

HTML Font Size

Browser Support

Elementchrome browser Chromeie browser IEfirefox browser Firefoxopera browser Operasafari browser Safari
<font size=””>YesYesYesYesYes

Comments

Leave a Reply

Your email address will not be published. Required fields are marked *