HTML font color The text color can be set in the <font> tag using color, or CSS style. In fact, there are many different ways to set the text color. Here are two common text color design methods, both It is a design method supported by mainstream browsers. For a web page with rich text colors, web designers will first preset a basic color that is most often presented. Usually the color is written in the CSS syntax, and then the text in the webpage with different colors is used as <font>. Or < span > and other text label tags, write specific label text into different color codes to create a rich web text color style. The following examples are common ways to add color to web text.
HTML font color text color example 1. Use color directly in <font><font color="blue">text color is blue</font>, <font color="#FF0000">text color is red</font>
The above example outputText color is blue , text color is red
Directly using color to mark colors in HTML <font> tags is the most traditional design method, and it is also a writing method supported by old browsers. The advantage of this writing method is that it is simple and fast, but the disadvantage is that for the <font> tag The color of the text hyperlink inside cannot be controlled. If you want to control the color of the text hyperlink, please refer to: modify the hyperlink color .HTML font color text color example 2: design font color through css style<span style="color:orange;">Text color is orange</span>
The above example outputText color is orange
The second example is to use the span tag to wrap the text that needs to be color-changed, and then modify the color of the text through the color property of the css style. After the style in the example, you can connect the style of the text. Here, "color:orange" means to The displayed text color is orange, and more colors can be selected from " Color Code Table ".
Post a Comment
0 Comments