The color representation in html consists of 6-digit hexadecimal code and rgb or keyword _ HTML/Xhtml _ webpage creation.

Source: Internet
Author: User
Tags color representation
In html, color represents the most commonly used 6-digit hexadecimal code notation. In addition, color can also be represented by rgb (r, g, B). r, g, B Represents red, green, and blue in decimal number or percentage from 0 to, respectively. If you are interested, you can see that there are 3 Representation Methods in the HTML, the most commonly used is the 6-digit hexadecimal code notation. For example, bgcolor = # ff0000; # indicates that the color is declared using a 6-digit hexadecimal color code. The first two digits of the Code, ff, represent the red color in the primary color, and the range is of course-ff in hexadecimal notation. The middle two digits, that is, 00, indicate green. The last two digits, that is, 00, indicate blue. 00 indicates no color, ff indicates that the color is the strongest. Therefore, 000000 indicates black, ffffff indicates white, ff0000 indicates pure red, 00ff00 indicates pure green, and 0000ff indicates pure blue.

In addition, the color can also be represented by rgb (r, g, B). r, g, and B in parentheses are represented by a decimal number or percentage ranging from 0 to 255, for example, rgb (255, 0, 0) and rgb (100%, 0%, 0%) indicate RED.

The color representation can also be represented by the color keyword, a total of 16, respectively:

Black and Black #000000
Maroon dark brown #800000
Green #008000
Olive #808000
Navy #000080
Purple #800080
Teal duck green #008080
Gray #808080
Silver # C0C0C0
Red # FF0000
Lime Acid Orange #00FF00
Yellow # FFFF00
Blue # 0000FF
Fuchsia pinghong # FF00FF
Aqua water blue #00 FFFF
White # FFFFFF

For example, bgcolor = red can be written as follows:

The Code is as follows:


Bgcolor = rgb (100%, 0, 0), bgcolor = rgb (0%, 0%,), bgcolor = # ff0000;

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.