Get the App
SLTechnology News&Howtos  ›  Development  › 

What color representations are supported by css3

Shulou Source: shulou.com Published: 2022-06-01 05:07:09 10月05日 Update

This article mainly introduces "which color representation methods are supported by css3". In the daily operation, I believe that many people have doubts about which color representation methods are supported by css3. The editor consulted all kinds of data and sorted out simple and easy-to-use operation methods. I hope it will be helpful to answer the doubts of "which color representation methods css3 supports". Next, please follow the editor to study!

Css3 color representation methods are: 1, expressed by the English name of color, example "red" means red; 2, expressed in hexadecimal, example "# ffff00"; 3, expressed by rgb () function; 4, expressed by hsl () function; 5, expressed by rgba () function; 6, expressed by hsla () function.

The operating environment of this tutorial: windows7 system, CSS3&&HTML5 version, Dell G3 computer.

The principle of three primary colors of color light

The three primary colors of color light are red (Red), green (Green) and blue (Blue), which can form colorful colors.

If you really don't remember, turn left here to Baidu encyclopedia.

Color representation supported by CSS3

It is expressed by the English name of color. The English name represents a color, but it is limited and difficult to remember and query.

Expressed in hexadecimal colors. Color light tricolor principle, you can look up the table.

Denoted by rgb (r, g, b). Color light tricolor principle, red + green + blue.

Expressed by hsl (Hue, Saturation, Lightness). Hue + saturation + brightness.

Denoted by rgba (r, g, b, a). Color light tricolor principle, red, green, blue + transparency. A ∈ [0,1], 0 represents complete transparency.

Expressed by hsla (Hue, Saturation, Lightness, alpha). Hue, saturation, brightness + transparency. Alpha ∈ [0,1], 0 represents complete transparency.

Example:

CSS color indicates div > div {width: 400px; height: 40px;} for (var I = 0; I < 300; iTunes +) {[xss_clean] ("CSS color representation") } background-color:gray background-color:#888 background-color:#ffff00 background-color:rgb (0255,255) background-color:hsl (120,100%, 50%) background-color:rgba (0,255,255) 0.5) background-color:hsla (120,100%, 50%, 0.5)

Web page display

Description

The reason for adding text at the end is to verify transparency.

At this point, the study of "which color representations are supported by css3" is over. I hope to be able to solve your doubts. The collocation of theory and practice can better help you learn, go and try it! If you want to continue to learn more related knowledge, please continue to follow the website, the editor will continue to work hard to bring you more practical articles!

Tags: Color method support tricolor color light Sanyuan function principle red learning representative name green English name blue transparency English brightness hexadecimal more Apple Docker Huawei Linux macOS MariaDB Microsoft MySQL NVidia OPPO Reno Xiaomi Microsoft NVidia MariaDB Shulou Technology