Computer Study

Basefont Tag in HTML

The <basefont> tag in HTML is used to define the base font size, color, and face for a web page. This tag is used to set the default font size and other properties for all the text on a web page.

Syntax: The syntax for the <basefont> tag is as follows:

<basefont size=”size” color=”color” face=”face”>

Attributes:

The <basefont> tag has the following attributes:

  1. size: This attribute is used to specify the default font size for all the text on the web page. The size value can be a number from 1 to 7, where 1 is the smallest size and 7 is the largest size.
  2. color: This attribute is used to specify the default font color for all the text on the web page. The color value can be specified using a color name, hexadecimal value, or RGB value.
  3. face: This attribute is used to specify the default font face for all the text on the web page. The face value can be any valid font name or font family.

Example:

Here is an example of how to use the <basefont> tag to set the default font size, color, and face for a web page:

<!DOCTYPE html>
<html>
<head>
<title>Basefont Tag Example</title>
<basefont size=”4″ color=”#0000FF” face=”Arial”>
</head>
<body>
<h1>This is a heading</h1>
<p>This is a paragraph.</p>
<p>This is another paragraph.</p>
</body>
</html>

In this example, the <basefont> tag is used to set the default font size to 4, default font color to blue, and default font face to Arial for all the text on the web page.

Note: The <basefont> tag is deprecated in HTML5 and is no longer supported by most modern browsers. It is recommended to use CSS to set the font size, color, and face for a web page.

Related Articles

Leave a Reply

Your email address will not be published. Required fields are marked *

Check Also
Close
Back to top button