HTML basefont color Attribute
HTML <basefont> tag
Definition and Usage
The color attribute specifies the base (default) font color for a page.
Compatibility Notes
The basefont element was deprecated in HTML 4.01
and is not supported in XHTML 1.0 Strict DTD.
Use CSS instead.
CSS syntax (in <head>): <style>body{color:red}</style>
In our CSS tutorial you can find more details about the
text color property.
Syntax
<basefont color="color_value" />
|
Syntax Example
Attribute Values
Value |
Description |
color_name |
Specifies the color with a color name, like "red" |
RGB_value |
Specifies the color with a RGB value, like "rgb(255,0,0)" |
Hex_value |
Specifies the color with a hex value, like "#ff0000" |
Browser Support
The attribute is deprecated, only supported by Internet Explorer, and should be avoided.
Example
<html>
<head>
<basefont color="red" />
</head>
<body>
<p>Hello. Welcome to W3Schools.</p>
</body>
</html>
|
Try-It-Yourself Demos
body
color attribute example
Set the default font color with the basefont color attribute.
In CSS:
default
font color example
Set the default font color with CSS.
HTML <basefont> tag
|
|
|