">. Where Home >
Article > Web Front-end > How to set color of html font To set the font color in HTML, you can use the color attribute of CSS, and the syntax is How to set HTML font color Setting font color in HTML is very simple, you just use CSS Syntax: Where: Example: Use predefined color name: 这个文字是红色的。 Use hex code: Use RGB code: Note: The The above is the detailed content of How to set color of html font. For more information, please follow other related articles on the PHP Chinese website!How to set color of html font
color
attributes.
is the HTML element you want to set the color , such as ,
, or
.
is a predefined color name defined by CSS, such as "red", "blue", or "black".
is a six-digit hexadecimal code that represents the color, such as "#FF0000" (red).
is an RGB code that represents the color, such as "rgb(255, 0, 0)" (red). 这个标题是红色的。
这个文本是红色的。
color
attribute can be applied to any HTML element. font-color
attribute, but it is deprecated and it is recommended to use color
.