<p>The way to change font color in HTML is to use the color attribute, which can specify a color name, a hexadecimal color code, an RGB/RGBA value, or an HSL/HSLA value.<p>
color
properties. The syntax is as follows: <p style="color: red;">文字</p>
<p>
is a paragraph element used to contain text content. The style
attribute is used to set the style of an element. color
property specifies the color of the text. #ff0000
for red), The color
attribute also supports the following syntax: red
, green
, blue
, etc. rgb(255, 0, 0)
means red. rgba(255, 0, 0, 0.5)
Represents red with 50% transparency. hsl(0, 100%, 50%)
Represents red with 100% saturation and 50% brightness. hsla(0, 100%, 50%, 0.5)
Represents a red color with 100% saturation, 50% brightness, and 50% transparency. color
property to change the font color: 文字
<p style="color: red;">文字</p>文字
文字
文字
文字
The above is the detailed content of How to change font color in html. For more information, please follow other related articles on the PHP Chinese website!