You can format the text in a webpage by setting the < font > ... < /font > tag and various font attributes. The font tag is having three attributes called size, color, and face for customize text in a webpage.

Font Face

The Font Face attribute specifies the font name of the text inside a Font tag.

<font face="Arial"> Arial Font </font>

When you specify a Font Face, the typeface you specify must be installed on the computer of the person viewing the web page.

The value of the face attribute can hold several font names separated by a comma.

<font face="Sans serif,Comic Sans MS,Lucida Console>

A visitor will only be able to see your font if they have that font installed on their computer.

When your page is loaded, browser will display the first font face that it has available, otherwise second one and so on. If the specified fonts are not installed on your computer then it will load default font face of web browser. Always use double quotes around the font names.

Font Size

You can set the size of the font by changing the size attribute of < font > tag.

<font size=7>Font size 7</font>

Above HTML code looks in a browser:


You can set font size by specify the relative font size also. That is, how many sizes larger or how many sizes smaller than the present font size

<font size="-2">Font size -2 from the current font size</font> <font size="+2">Font size +2 from the current font size</font>

Font Color

The Color attribute specifies the color of the text inside a Font tag. You can specify the color that you want by either the color name or hexadecimal code for that color.

<font color="Green">Font color is green</font> <font color="#008000">Specify hexcolor #008000</font>

You can use Face, Size and Color attributes together one < Font > tag.


HTML Source Code :

<html> <body> <font face="arial,helvetica" , size=6 , color=red > HTML Font Tutorial </font> </body> </html>


Fonts are specific to Operating systems, if you are using different Operating systems then you will have different look and feel . HTML < FONT > tag is deprecated in version 4.0 onwards.