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

coldplay.xixi
coldplay.xixiOriginal
2021-03-16 14:34:3214523browse

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.

How to set text color in css

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!

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn