HTML font color Attribute
HTML <font> tag
Definition and Usage
The color attribute specifies the font color of the content within the font
element.
Compatibility Notes
The font element was deprecated in HTML 4.01
and is not supported in XHTML 1.0 Strict DTD.
Use CSS instead.
CSS syntax: <p style="color:red">
In our CSS tutorial you can find more details about the
text color property.
Syntax
<font color="color_value">
|
Syntax Example
Attribute Values
Value |
Description |
color_name |
Specifies the color using a color name. Like "red" |
rgb_value |
Specifies the color using a RGB value. Like "rgb(255,0,0)" |
hex_value |
Specifies the color using a hex value. Like"#ff0000" |
Browser Support
The attribute is deprecated, but still supported in all major browsers.
Example
Source |
Output |
<font color="red">
<p>Welcome to W3Schools</p>
</font> |
Welcome to W3Schools
|
Try-It-Yourself Demos
font color
attribute example
Set the font color of a group of elements with the font color attribute.
In CSS:
text color example
Set the font color of a single, and a group of elements with CSS.
HTML <font> tag
|
|
|