To set the font color in HTML, use the color attribute. Syntax:
, where color-value can be a color name, a hexadecimal color code, or an RGB color code. For example, to make paragraph text red: Paragraph text
.
How to set the font color in HTML
Setting the font color in HTML is very simple, just use color
Attributes are enough.
Syntax:
<code class="html"><element style="color: color-value;"></code>
Where:
is the HTML element to set the font color, for example
,
or
.
color-value is the font color value to be set, it can be:
Example:
To set the font color of all text in a paragraph to red, you can use the following code:<code class="html"><p style="color: red;">段落文本</p></code>
<code class="html"><h1 style="color: #0000ff;">标题文本</h1></code>
Note:
The above is the detailed content of How to set the font color of html. For more information, please follow other related articles on the PHP Chinese website!