CSS Color Usage Instructions _ Basic Tutorial

Source: Internet
Author: User
Red color
Equivalent to
RGB (255,0,0)
Equivalent to
RGB (100%,0%,0%)
Equivalent to
#ff0000
Equivalent to
#f00
There are 17 pre-determined colors, which are:
Aqua, black, blue, fuchsia, gray, green, lime, maroon, navy,
Olive, orange, purple, red, silver, teal, white, and yellow.
The transparent is also a correct value.

The three values of RGB are from 0 to 255,0 are the lowest, 255 are the highest, and these values can also be percentages.

We usually use the 10 binary as 0-9, but the hexadecimal uses the 16 binary, which is 0 to F.

Hex three or six digit length preceded by the # character, three length is six compression form, for example #f00 is ff0000 compression, #c96是 #cc9966. Three-digit very good understanding, like RGB, the first is red, the second is green, the third blue. But the six-digit number gives more color control.

Color and Background-color

Colors can use color and background-color, which is "color" is not "colour" in American English.
Blue background, yellow text:


H1 {
Color:yellow;
Background-color:blue;
}
These colors may be rough and you can use different shades:


Body {
Font-size:0.8em;
Color:navy;
}
H1 {
Color: #ffc;
Background-color: #009;
}
You can see that the H1 has turned yellow and blue.
Color and Background-color can be used in most HTML elements, including body.
  • Related Article

    Contact Us

    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.

    A Free Trial That Lets You Build Big!

    Start building with 50+ products and up to 12 months usage for Elastic Compute Service

    • Sales Support

      1 on 1 presale consultation

    • After-Sales Support

      24/7 Technical Support 6 Free Tickets per Quarter Faster Response

    • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.