----Color Edition----

Source: Internet
Author: User

In CSS, there are three common ways of setting colors: 1. Color name (red) 16 binary (#ccc)  2.rgb (128,128,128) 3.HSL (330,50%,50%) Chroma Saturation Brightness

which

R: Red value. Positive integers | Percentage
G: Green value. Positive integers | Percentage
B: Blue value. Positive integers | Percentage

H:hue (hue). 0 (or 360) indicates red, 120 is green, 240 is blue, and other values are preferred to specify the color. Value is: 0-360
S:saturation (saturation). Values are: 0%-100%
L:lightness (brightness). Values are: 0%-100%

eg

Html:

<div class= "Div1" style= "width:200px;height:200px" >div1 HEX #ccc </div>
<div class= "Div2" style= "width:200px;height:200px" >div2 rgb</div>
<div class= "Div3" style= "width:200px;height:200px" >div3 hsl</div>

Css:

body{

Display:flex;
Flex-wrap:wrap;

}

. Div1{background-color: #ccc;}

. DIV2{BACKGROUND-COLOR:RGB (128, 128, 128);}

. DIV3{BACKGROUND-COLOR:HSL (330, 20%, 50%);}

Effect

----Color Edition----

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.