Open In App

HTML <font> Tag

Last Updated : 11 Jul, 2025
Comments
Improve
Suggest changes
Like Article
Like
Report

The HTML <font> Tag plays an important role in the web page to create an attractive and readable web page. The font tag is used to change the color, size, and style of a text and it was used in HTML4. The base font tag is used to set all the text to the same size, color, and face.

Note: Font tag is not supported in HTML5

HTML
<!DOCTYPE html>
<html>

<body>
    <p>This is sample paragraph</p>
    <font face="Arial" size="4" color="green">
        This paragrap style by font tag
    </font>
</body>

</html>

Syntax

<font size="number" face="font_family" color="color_name|hex_number|rgb_number">

Font Attributes

Font Size

The Font size attribute is used to adjust the size of the text in the HTML document using a font tag with the size attribute. The range of size of the font in HTML is from 1 to 7 and the default size is 3.

HTML
<!DOCTYPE html>
<html>

<body>
    <!--HTML font size tag starts here-->
    <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>
    <!--HTML font size tag ends here-->
</body>

</html>

Font Type

The Font type can be set by using face attribute with font tag in HTML document. But the fonts used by the user need to be installed in the system first.

HTML
<!DOCTYPE html>
<html>

<body>
    <font face="Times New Roman" size="6">
            GeeksforGeeks!!
    </font><br /> 
    <font face="Verdana" size="6">
            GeeksforGeeks!!
    </font><br /> 
    <font face="Comic sans MS" size=" 6">
            GeeksforGeeks!!
    </font><br /> 
    <font face="WildWest" size="6">
            GeeksforGeeks!!
    </font><br /> 
    <font face="Bedrock" size="6">
            GeeksforGeeks!!
    </font><br />
</body>

</html>

Font Color

The Font color is used to set the text color using a font tag with the color attribute in an HTML document. Color can be specified either with its name or with its hex code.

HTML
<html>
<body>
    <p>
        <font color="green">G</font>
        <font color="blue">e</font>
        <font color="red">e</font>
        <font color="yellow">k</font>
        <font color="purple">s</font>
        for
        <font color="orange">G</font>
        <font color="pink">e</font>
        <font color="brown">e</font>
        <font color="teal">k</font>
        <font color="gray">s</font>
    </p>
</body>
</html>

HTML <font> Tag

Similar Reads