CSS Color Colors Use instructions _ Basic Tutorial
Source: Internet
Author: User
Red color
Equal to
RGB (255,0,0)
Equal to
RGB (100%,0%,0%)
Equal to
#ff0000
Equal to
#f00
There are 17 predefined colors, which are:
Aqua, black, blue, fuchsia, gray, green, lime, maroon, navy,
Olive, orange, purple, red, silver, teal, white, and yellow.
Transparent is also a correct value.
RGB three values are from 0 to 255,0 is the lowest, 255 is the highest, these values can also be percentages.
We usually use 10 in 0-9, but hexadecimal uses 16, or 0 to F.
Hexadecimal three or six digit lengths are preceded with a # character, and three lengths are six compression forms, such as #f00 is ff0000 compression, #c96是 #cc9966. Three digits are well understood, like RGB, the first is red, the second is green, and the third is blue. But the six-digit number gives more color control.
Color and Background-color
Colors can be used with color and Background-color, is American English "color" is not "colour".
Blue background, yellow text:
H1 {
Color:yellow;
Background-color:blue;
}
These colors may be coarse and you can use additional chroma:
Body {
Font-size:0.8em;
Color:navy;
}
H1 {
Color: #ffc;
Background-color: #009;
}
You can see the H1 has turned yellow and blue.
Color and Background-color can be used in most HTML elements, including the body.
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.