January 2018
Intermediate to advanced
678 pages
20h 16m
English
With CSS (and also with HTML), there are sometimes multiple ways to accomplish the same thing. That point is particularly pertinent when it comes to specifying colors. You’ve already learned how to specify color values with names, the rgb construct, and the rgba construct. Now for the hsl construct. Here’s the syntax:
hsl(hue-integer,saturation-percent,lightness-percent)
HSL stands for hue, saturation, and lightness. Hue is a degree on the color wheel shown in FIGURE 3.15. The wheel is a circle, so the wheel’s degrees go from 0 to 360. As you can see in the figure, 0 degrees is for red, 120 degrees is for green, and 240 degrees is for blue. For a circle, 0 degrees is equivalent to 360 degrees. So, to specify ...
Read now
Unlock full access