www.php.cn]; 2. In the CSS selector Use color color style CSS code."/> www.php.cn]; 2. In the CSS selector Use color color style CSS code.">
Home > Article > Web Front-end > How to set text color in css
How to set text color in css: 1. Use the color color style in the DIV tag, the code is [21d164060e752a55e29251fc54717ce1www.php.cn16b28748ea4df4d9c2150843fecfba68] ;2. Use the color color style CSS code in the CSS selector.
The operating environment of this tutorial: windows7 system, css3 version, DELL G3 computer.
How to set text color in css:
1. Use the color color style in the DIV tag
<div style="color:#F00">www.php.cn</div>
2. Use the color color style CSS code in the CSS selector:
.divcss5{color:#00F} /* 设置对象divcss5内文字为蓝色 */
Extended reading: Here are instructions for setting this style using CSS comments, understand CSS comments
3. Complete example of DIV CSS color style:
Css code:
The code is as follows:
.divcss5{color:#00F} /* 设置对象divcss5内文字为蓝色 */
HTML code:
The code is as follows:
<p> 标签内使用color css样式 <div style="color:#F00">www.php.cn 红色</div> </p> <p>外部样式表设置对象color颜色 <div class="divcss5">www.php.cn 蓝色</div> </p>
Related learning recommendations: css tutorial
The above is the detailed content of How to set text color in css. For more information, please follow other related articles on the PHP Chinese website!