Home > Article > Web Front-end > How to change the color of html font
To change the font color in HTML, you can use the color attribute in CSS. The specific steps are as follows: Select the text element (for example, p, h1, span) that you want to change color. Use the color attribute to specify the color value to apply, which can be a hexadecimal color code, an RGB value, or an HTML color name. CSS code can be applied to HTML documents using the
这是蓝色文本。
You can also use inline CSS to set the
color
attribute directly in the HTML element:
这是蓝色文本。