CSS3 Tutorial (Ten): CSS3 HSL declaration Set color _css3_css_ Web Authoring

Source: Internet
Author: User
Web Page Authoring WEBJX article introduction: Using the CSS3 HSL declaration is also used to set the color. What's next? HSLA? Yes, this is the same as the Rgba effect. Using the CSS3 HSL declaration is also used to set the color. What's next? HSLA? Yes, this is the same as the Rgba effect. Previous article


Using the CSS3 HSL declaration is also used to set the color. What's next? HSLA? Yes, this is the same as the Rgba effect.
Using the CSS3 HSL declaration is also used to set the color. What's next? HSLA? Yes, this is the same as the Rgba effect.
Previous post: CSS3 Tutorial (9): Setting RGB Colors
The HSL declaration uses Hue Hue (H), saturation saturation (s), and Luma lightness (L) to set the color.
Hue is derived from the color dial: 0 and 360 are red, close to 120 is green, 240 is blue.
Saturation value is a percentage: 0% is grayscale, 100% saturation is highest
The lightness value is also a percentage: 0% is the darkest, 50% mean, and 100% brightest.
Caprice: Why is "ligntness"? Maybe I'm more used to the "brightness" in Photoshop ...
Browser compatibility:
HSL and Hsla are now supported by Firefox, Google Chrome, and Safari browsers, and do not require any prefix CSS3 HSL

The above demo is implemented by the following styles
div.hsll1 {BACKGROUND:HSL (100%, 50%); height:20px;} div.hsll2 {BACKGROUND:HSL (+/-50%, 50%); height:20px;} div.h slL3 {BACKGROUND:HSL (100%, 75%); height:20px;} div.hsll4 {BACKGROUND:HSL (202, 100%, 50%); height:20px;} div.hslL5 {BACKGROUND:HSL (202, 50%, 50%); height:20px;} div.hsll6 {BACKGROUND:HSL (202, 100%, 75%); height:20px;}
Browser support:

Firefox (3.05 ...)

Google Chrome (1.0.154 ...)

Google Chrome (2.0.156 ...)

Internet Explorer (IE7, IE8 RC1)

Opera (9.6 ...)

Safari (3.2.1 windows ...) CSS3 HSLA

The above effect is implemented by the following styles:
Div.hslal1 {Background:hsla (165, 35%, 50%, 0.2); height:20px;} div.hslal2 {Background:hsla (165, 35%, 50%, 0.4); Height: 20px; } div.hslal3 {Background:hsla (165, 35%, 50%, 0.6); height:20px;} div.hslal4 {Background:hsla (165, 35%, 50%, 0.8); Heigh t:20px; } DIV.HSLAL5 {Background:hsla (165, 35%, 50%, 1.0); height:20px;}
Browser support:

Firefox (3.05 ...)

Google Chrome (1.0.154 ...)

Google Chrome (2.0.156 ...)

Internet Explorer (IE7, IE8 RC1)

Opera (9.6 ...)

Safari (3.2.1 windows ...)

The above is CSS3 Tutorial (Ten): CSS3 HSL Statement set Color _css3_css_ Web page production content, more relevant content please pay attention to topic.alibabacloud.com (www.php.cn)!

  • 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.