HTML basic tutorial color representation
html Color Representation
There are three ways to express colors in web pages:
Color words: blue, green, red, yellow
- ##Decimal representation: rgb(255,0,0), rgb(0,255,0), rgb(0,0,255)
- Hexadecimal representation: #FF0000 (red), #00FF00 (green), #0000FF (blue)
red light(red),green light(green),blue(blue).
In computers, each primary color uses 8-bit binary (2^8 = 256), so RGB can represent a total of 256*256*256 = 16.7 million colors. When using hexadecimal to represent color: use 2 hexadecimal digits to represent 1 digit of the primary color.Color words |
##red |
green |
blue |
yellow |
Decimal |
rgb(255,0,0) | ##rgb(0,255,0)
## rgb(0,0,255) |
rgb(255,255,0) |
|
#FF0000 |
#00FF00 |
#0000FF |
#FFFF00 |
##Note: Decimal compatibility is not good, so use it as little as possible. Decimal color representation, commonly used in CSS. |
这是我们的第一个页面
红 | ||
绿 | ||
蓝 |