Skip to content
Related Articles

Related Articles

Improve Article
HTML <basefont> Tag
  • Last Updated : 05 Feb, 2021

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.so, as an alternate, we are using CSS in the example code. The <basefont> tag was supported in Internet Explorer 9, and earlier versions.

Syntax:

<basefont attributes...>

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

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

Example: Below example illustrates the <basefont> tag in HTML.

HTML




<!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>

Output: 
 

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

My Personal Notes arrow_drop_up
Recommended Articles
Page :