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)

From the interface, All colors can be created by mixing three different wavelengths of light. These three kinds of light are

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.

##rgb(0,255,0) Hexadecimal ##Note: Decimal compatibility is not good, so use it as little as possible. Decimal color representation, commonly used in CSS. Example:
Color words
##red
green
blue
yellow
Decimal
rgb(255,0,0)

## rgb(0,0,255)

rgb(255,255,0)


#FF0000

#00FF00

#0000FF

#FFFF00
    这是我们的第一个页面 
绿

Continuing Learning
||
这是我们的第一个页面
绿
submit Reset Code
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!