Latest web development tutorials

HTML font color attribute

HTML font tags Reference Manual HTML <font> tag

Examples

Predetermined color of the text:

<font color="red">This is some text!</font>

try it"

Browser Support

Internet ExplorerFirefoxOperaGoogle ChromeSafari

All major browsers support color attributes.


Definition and Usage

HTML5 does not support the <font> tag. Please be replaced with CSS.

In HTML 4.01, <font> The color attribute obsolete .

color attribute specifies the <font> element of the Chinese color.


Compatibility Notes

In HTML 4.01, <font> The color attribute is discarded. Please be replaced with CSS.

CSS Syntax: <p style = "color: red">

Color settings of the text: CSS Examples

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


grammar

<font color="color_name|hex_number|rgb_number">

Property Value

描述
color_name 规定颜色值为颜色名称的文本颜色(比如 "red")。
hex_number 规定颜色值为十六进制值的文本颜色(比如 "#ff0000")。
rgb_number 规定颜色值为 rgb 代码的文本颜色(比如 "rgb(255,0,0)")。


HTML font tags Reference Manual HTML <font> tag