Crimson
Gold
LightSalmon
SeaGreen
MidnightBlue
Indigo
Results:
Crimson
Gold
LightSalmon
SeaGreen
MidnightBlue
Indigo
HSL is the initial letter of Hue, Saturation and Lightness , its symbol is hsl (hue, saturation, lightness).
Inside:
For example: Try changing the values in the HSL style with some colors according to the CSS code below:
Crimson
Gold
LightSalmon
SeaGreen
MidnightBlue
Indigo
Results:
Crimson
Gold
LightSalmon
SeaGreen
MidnightBlue
Indigo
HSLA Color is an extension of the HSL color value with the addition of an opacity index that regulates the opacity / transparency of colors.
The syntax of this type of color is hsla (hue, saturation, lightness, alpha) , in which alpha is an opacity index with a value of 0.0 - 1.0, the smaller the value, the more transparency.
(Compare with HSL's upper analog palette to see the difference)
For example: Try changing the HSLA values with some colors according to the CSS code below:
Crimson
Gold
LightSalmon
SeaGreen
MidnightBlue
Indigo
Results:
Crimson
Gold
LightSalmon
SeaGreen
MidnightBlue
Indigo
Opacity determines the opacity and transparency of an element.
This attribute can get values from 0.0 to 1.0, the smaller the value, the more transparency.
However, the disadvantage of using opacity to add opacity to the background of an element is that all of the inner elements will inherit the opacity of the same element (including the text). This makes the text inside the element with high opacity difficult to read:
For example: Try changing the opacity attribute values with some colors according to the CSS code below:
Crimson
Gold
LightSalmon
SeaGreen
MidnightBlue
Indigo
Results:
Crimson
Gold
LightSalmon
SeaGreen
MidnightBlue
Indigo
Previous post: Multiple Background in CSS
Next lesson: Color transition effect (Gradient) in CSS