Font text"; 2. Use the style attribute in the label element containing the font text and add "color: Color value;" style is enough."/> Font text"; 2. Use the style attribute in the label element containing the font text and add "color: Color value;" style is enough.">
Home > Article > Web Front-end > How to set html font color
htmlHow to set font color: 1. Use the font tag, the syntax "font text"; 2. In the label element containing the font text Use the style attribute in and add the "color: color value;" style.
The operating environment of this tutorial: Windows 7 system, CSS3&&HTML5 version, Dell G3 computer.
Method 1: Use the font tag
to specify the font, font size, and font color of the text.
Syntax for setting font color:
<font color="颜色值">字体文本</font>
Example:
<!DOCTYPE html> <html> <head> <meta charset="utf-8"> </head> <body> <div>我是默认黑色字体</div> <div><font color="red">我是红色字体</font></div> </body> </html>
Rendering:
##Method 2: Use the style attribute to add the "color: color value;" style
Example:<!DOCTYPE html> <html> <head> <meta charset="utf-8"> </head> <body> <div>我是默认黑色字体</div> <div style="color: red;">我是红色字体</div> </body> </html>Rendering:
Recommended tutorial: "
html video tutorial"
The above is the detailed content of How to set html font color. For more information, please follow other related articles on the PHP Chinese website!