Latest web development tutorials

HTML basefont color attribute

Tag Reference HTML basefont HTML <basefont> tag

Examples

Specify a default font-color for text on page:

<head>
<basefont color="red" />
</head>

<body>
<h1>This is a header</h1>
<p>This is a paragraph</p>
</body>

try it"

Browser Support

Internet ExplorerFirefoxOperaGoogle ChromeSafari

Only Internet Explorer 9 and earlier versions of IE supports color attributes.


Definition and Usage

HTML5 is no longer supported <basefont> tag. Use CSS to set.

<Basefont> The color attribute is deprecated in HTML 4.01.

color attribute specifies the default color of the Chinese document.


Compatibility Notes

In HTML 4.01 deprecated color properties basefont element; in XHTML 1.0 Strict DTD not supported color attribute basefont element.

CSS syntax (in the <head> section): <style> body {color: red} </ style>

CSS Example: The default text color is specified page

In our CSS tutorial you can find more information about the details of the text color attributes .


grammar

<basefont color="color_name|hex_number|rgb_number" />

Property Value

value description
color_name Predetermined color is the color of the font color name (such as "red").
hex_number Predetermined color value is a hexadecimal value of font color (eg "# ff0000").
rgb_number Rgb color code is specified font color (such as "rgb (255,0,0)").


Tag Reference HTML basefont HTML <basefont> tag