CSS Basics: Data Types Part 2

Colors

  • HEX
#ff0033;
#f03;

The abbreviation (line 2) only works when there's 3 consecutive pairs of 2 like above which code for the same color.

  • rgb (red, green, blue)
rgb(255, 169, 73)

This is the color orange.

255 represents pure white (max). 0 represents pure black (min).

  • rgba
    • a is alpha which controls opacity.
rgba(255, 169, 73, .4)

.4 is equal to 40%.