There are 3 colors in HTML, and the most commonly used code representation is the 6-bit hexadecimal code representation. For example, bgcolor=#ff0000; where # just means using a 6-bit hexadecimal color code to declare the color. The first two digits of the code, ff, represent the red among the three primary colors. The range is of course 00-ff in hexadecimal, 00, 00, represent the green, the last two digits, 00, represent the blue, 00, represent the color has no color, and ff means the strongest color. So 000000 means black, ffffff means white, and ff0000 means pure red, 00ff00 means pure green, and 0000ff means pure blue.
In addition, the color can also be represented by rgb(r,g,b), and r,g,b in brackets are represented by decimal numbers or percentages of 0-255, respectively. For example, rgb(255,0,0) and rgb(100%, 0%, 0%) represent red.
The representation of color can also be represented by the keywords of color, with a total of 16, namely:
Black #000000
Maroon Dark Brown #800000
Green Green #008000
Olive Olive #808000
Navy Navy #000080
Purple Purple #800080
Teal Duck Green #008080
Gray Gray #808080
Silver Silver#C0C0C0
Red Red #FF0000
Lime Lime #00FF00
Yellow #FFFF00
Blue Blue #0000FF
Fuchsia Magenta #FF00FF
Aqua Water Blue#00FFFF
White White #FFFFFF
For example, you can write it like this: bgcolor=red, which is equivalent to the following writing methods:
Copy the code