Home > Web Front-end > CSS Tutorial > Detailed introduction to css color

Detailed introduction to css color

零下一度
Release: 2017-06-16 15:42:50
Original
3086 people have browsed it

color: Specify color. See Color Units and Appendix: Color Table
Description:
Retrieve or set the text color of the object. No default value.
Note that specifying color with a color name is not accepted by some browsers.
The corresponding script feature is color. Please see other books I have written.
Example:

div {color: #345456; } 
div { color: rgb(100,14,200); } 
div {color: menu; } 
div {color: red; }
Copy after login

color is the color of the font,

background-color is the color of the background

color attribute in css Can I inherit it~! ! ?

The color attribute in css can be inherited. First, you need to understand the concept of the parent element, just like a div wrapping p or some other tags. These colors can be inherited. Yes, but some tags cannot be inherited, such as the a tag, you need to change it manually. For details, you can see the code:

<html>
<head>
<style>
#round{
color:#f00;   //红色
}
a{
color:#0f0;  //绿色   需要单独设置
}
</style>
</head>
<body>
<div id="round">
<p>测试文字1</p>
<p>测试文字2</p>
<a href=&#39;&#39;>测试</a>
</div>
</body>
</html>
Copy after login

How to set the font color in CSS

Detailed introduction to css color

Implementation principle:

Set the font color through the color of the paragraph

tag.

Code meaning:

Define the color as red.

Original code:

<html>
<head>
<meta http-equiv="content-type" content="text/html;charset=gbk" />
<title></title>
</head>
<body>
<p style="color: red;">我要把字体设置为红色</p>
</body>
</html>
Copy after login

The above is the detailed content of Detailed introduction to css color. For more information, please follow other related articles on the PHP Chinese website!

Related labels:
Statement of this Website
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
Latest Issues
How to apply transparency in CSS color variable?
From 1970-01-01 08:00:00
0
0
0
How to apply opacity to CSS color variables?
From 1970-01-01 08:00:00
0
0
0
How to apply opacity on CSS color variable?
From 1970-01-01 08:00:00
0
0
0
How to apply transparency to CSS color variables?
From 1970-01-01 08:00:00
0
0
0
css - animation color change problem
From 1970-01-01 08:00:00
0
0
0
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template