What is HTML <basefont> tag ?
HTML <basefont> tag is used to set default font face, size, and color for text inside the webpage.
HTML <basefont> tag is used in both head and body section.
HTML <basefont> tag was used in HTML4 specification.
HTML <basefont> tag is removed in HTML5 specification.
Why HTML <basefont> tag is used ?
HTML <basefont> tag was used in HTML4 for setting default font face, size, and color for all elements.
In HTML5, We can use use CSS properties such as font, font-family, font-size, and color to change the font configuration for text elements.
HTML coding for a website !!!
Click to Learn More about – HTML Tutorial for beginners
Syntax :
<basefont size="14" color="green"/>
Example :
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html>
<head>
<title>HTML basefont tag</title>
<basefont size="14" color="green"/>
</head>
<body>
<p>HTML basefont tag</p>
</body>
</html>
Output :
<basefont> Tag Attributes
HTML <basefont> tag support following specific attributes.
Sno | Attributes | Value | Description |
---|---|---|---|
1 | color | #XXXXXX | Define a base URL link. |
2 | target | fontname | Define a default font face. |
3 | size | size | Define a default font size. |
Browser Compatibility
Sno | Browser | Support |
1 | Chrome | No |
2 | Firefox | No |
3 | Edge | No |
4 | Opera | No |
5 | Safari | No |
6 | Internet Explorer | No |