HTML font color can be adjusted through CSS properties. Method: use the color attribute. Color values can be hexadecimal values, RGB values, RGBA values, or color names. For example: color: #FF0000; sets the red font; color: rgb(255, 0, 0); also sets the red font.
How to adjust the font color in HTML
In HTML, you can adjust the font color through CSS properties. You can use the color
attribute.
Syntax:
<code class="css">color: [颜色值];</code>
Color value:
Color value can be in one of the following formats:
Usage 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>
To set the font color of a specific word to blue, you can use the following code:
<code class="html"><p>这是 <span style="color: blue;">蓝色的</span> 单词。</p></code>
Note:
The above is the detailed content of How to adjust font color in html. For more information, please follow other related articles on the PHP Chinese website!