Color
Learn about the vast variety of colors used to style HTML elements.
We'll cover the following...
Apart from green
or black
, we sometimes want to use a wider palette of colors. How can we do that?
We can expand the range of colors that we can use to style HTML elements by using RGB, Hex, and HSL values.
Press + to interact
rgb
and rgba
values
rgb
values refer to using red, green, and blue parameters to define a color. You can specify a color by indicating the intensity of each color attribute from a range of 0
to 255
. Click the sliders below to see the range of colors you can specify using RGB values:
As you can see, using rgb
values gives access to a much wider selection of color values. Let’s use an RGB ...