HTML | <basefont> Tag

It is used to set the default text-color, font-size, font-family of all the text in the browser. It is not supported in HTML 5.

Note: This tag can be used in both <head> and <body> element.

Syntax:

<basefont attributes...>

Optional Attributes: This tag contains three optional attributes which are listed below:

  • color: It is used to specify the default text-color of document.
  • size: It is used to specify the default font-size of document.
  • face: It is used to specify the default font-style of document.

Below example illustrates the <basefont> tag in HTML:

Example:

filter_none

edit
close

play_arrow

link
brightness_4
code

<!DOCTYPE html>
<html>
    <head>
        <title>basefont tag</title>
        <basefont color="red" size="9">
        <style>
            body {
                text-align:center;
            }
            .gfg {
                font-size:40px;
                font-weight:bold;
                color:green;
            }
            .geeks {
                font-size:25px;
                font-weight:bold;
            }
        </style>
    </head>
    <body>
    <div class = "gfg">GeeksforGeeks</div>
    <div class = "geeks"><basefont> Tag</div>
    <p>A computer science portal for geeks</p>
    </body>
</html>                    

chevron_right


Output:

Supported Browsers: This tag is not supported by any browser.

Note: The <basefont> tag was supported in Internet Explorer 9, and earlier versions.



My Personal Notes arrow_drop_up

Check out this Author's contributed articles.

If you like GeeksforGeeks and would like to contribute, you can also write an article using contribute.geeksforgeeks.org or mail your article to contribute@geeksforgeeks.org. See your article appearing on the GeeksforGeeks main page and help other Geeks.

Please Improve this article if you find anything incorrect by clicking on the "Improve Article" button below.