Home >Web Front-end >HTML Tutorial >How to set font color in html
<p>To change the color of fonts in HTML, use the color attribute: Select the text whose color you want to change. Add the style attribute and set its value to an inline style block with a color value. Use the color property to set the desired color.<p> <p>How to set the font color using HTML <p>If you want to change the font color using HTML, you can use
color
Attributes.
<p>Steps:
<p>
or <span>
) wrap text. style
attribute: Add the style
attribute in the text tag and set its value to an inline style with a color value piece. color
attribute: Use the color
attribute in the style block and set its value to the desired hex color Code, RGB value, or color name. <code class="html"><p style="color: #000000;">这是黑色文本</p></code><p> Example:
<p style="color: #000000;">Black text</p>
White text
Red text< ;/p>
Green text
# in front of the
color attribute value to indicate hexadecimal color code.
(red).
The above is the detailed content of How to set font color in html. For more information, please follow other related articles on the PHP Chinese website!