Home > Article > Web Front-end > How to change html font color
There are two ways to modify the font color in HTML: use the CSS style attribute to set the color value; use the outdated tag's color attribute.
HTML font color modification
In HTML, you can modify the font color in two ways:
1. Using CSS
Example:
<code class="html"><p style="color: red;">这是红色文字</p></code>
Instructions:
attribute is used to set CSS styles on HTML elements.
property specifies the text color.
is a CSS color value representing red.
2. Use tag
Example:
<code class="html"><font color="green">这是绿色文字</font></code>
Description:
tag is an obsolete HTML element.
property specifies the text color.
is a CSS color value representing green.
Note:
tag is deprecated as it is obsolete and should be replaced by CSS.
The above is the detailed content of How to change html font color. For more information, please follow other related articles on the PHP Chinese website!