The color property allows you to specify the color of text inside an element. You can specify any color in CSS in one of three ways:
1. RGB values: These express colors in terms of how much red, green and blue are used to make it up. For example: rgb(100,100,90).
2. * hex codes*: These are six-digit codes that represent the amount of red, green and blue in a color, preceded by a pound or hash # sign. For example: #ee3e80
3. color names: There are 147 predefined color names that are recognized by browsers. For example: DarkCyan.
Background Color
CSS treats each HTML element as if it appears in a box, and the background-color property sets the color of the background for that box.
You can specify your choice of background color in the same three ways you can specify foreground colors: RGB values, hex codes, and color names.
CSS3: Opacity
opacity, rgba
CSS3 introduces the opacity property which allows you to specify the opacity of an element and any of its child elements. The value is a number between 0.0 and 1.0 (so a value of 0.5 is 50% opacity and 0.15 is 15% opacity).
The CSS3 rgba property allows you to specify a color, just like you would with an RGB value, but adds a fourth value to indicate opacity. This value is known as an alpha value and is a number between 0.0 and 1.0 (so a value of 0.5 is 50% opacity and 0.15 is 15% opacity). The rgba value will only affect the element on which it is applied (not child elements).