Browse By Name
HTMLCSSJavaScriptAppendix
You are here: Reference > HTML > attributes > color (basefont, font, hr)

color attribute (basefont, font, hr)

A A Font size Print Content Add new content Share Share
Browser support:
Sets the color of the text or line.
This attribute is deprecated. Use the color style property instead.
If you want to use this element dynamically, visit the JavaScript page for this attribute: color. You can find other example(s) there.

Possible values:

A legal color value. It can be a hexadecimal, RGB or predefined color value. For more information, see the page for colors.
Default: this attribute has no default value.

Example HTML code 1:

This example illustrates the use of the color attribute:
<font color="#FF0000">red text</font>
Did you find this example helpful? yes no

Example HTML code 2:

Recommendation:
<span style="color:#FF0000">red text</span>
Did you find this example helpful? yes no

Supported by tags:

Related pages:

External links:

User Contributed Comments

Post Content

Post Content