9. Fonts
Fonts play an important role in making a website easy to use and its content easier to read. The font face and text color depend entirely on the computer and browser used to view your page, but you can use the <font> tag in HTML to add style, size, and color to the text on your website. You can also use the <basefont> tag to give all the text the same size, face, and color.
9.1. <font> tag
The <font> tag sets the size, color, and typeface (face/family) of the text displayed on a web page.
The <font> tag has three attributes, size, color, and face, for customizing your text. To change any font property at any point in your web page, just use the <font> tag with the attribute name and its value. All the text that follows stays changed until you close it with the </font> tag. You can change one or all of the attributes in a single <font> tag.
9.2. Set Font Size
To set the font size on a web page, we use the size attribute. It lets us set the font size from 1 to 7, where 1 is the smallest size and 7 is the largest. The default font size is 3.
9.3. Relative Font Size
Relative font size means setting the font a certain number of steps larger or smaller than the default (preset) font size. We can set it as <font size = "+n"> or <font size = "-n">.
Source Code:
<!DOCTYPE html>
<html>
<head>
<title>Font Size Example</title>
</head>
<body>
<h2>Font Size Example</h2>
<!-- Absolute size -->
<p><font size="1">Size 1 (smallest)</font></p>
<p><font>Normal Size (default)</font></p>
<p><font size="3">Size 3 (default)</font></p>
<p><font size="7">Size 7 (largest)</font></p>
<!-- Relative size -->
<p><font size="+2">Relative +2 (larger)</font></p>
<p><font size="-1">Relative -1 (smaller)</font></p>
</body>
</html>Result:
Watch the video:


