📅  最后修改于: 2023-12-03 15:14:18.406000             🧑  作者: Mango
CSS HSLA is a color notation system that stands for Hue, Saturation, Lightness, and Alpha. It was introduced as an extension of the HSL (Hue, Saturation, Lightness) color model, adding an alpha channel for transparency control.
The syntax for the HSLA function is as follows:
color: hsla(hue, saturation, lightness, alpha);
Where:
/* Set the color of an element to red */
color: hsla(0, 100%, 50%, 1);
/* Set the color of an element to green with 50% opacity */
color: hsla(120, 100%, 50%, 0.5);
/* Set the background color of an element to a semi-transparent black */
background-color: hsla(0, 0%, 0%, 0.5);
The HSLA function is supported by all modern browsers, including Internet Explorer 9 and above.
CSS HSLA is a powerful color notation system that provides more control over the transparency of colors. It's easy to use and widely supported by modern browsers.