CSS works by associating rules with HTML elements. A CSS rule contains two parts: a selector and a declaration. Selectors indicate which element the rule applies to, and declaration indicate how the elements referred to in the selector should be styled. CSS declaration consist of two parts: a property and a value. CSS rules appear in a separate style sheet or in the same page as HTML code.
CSS color systems:
- RGB values: Values for red, green, and blue are expressed as numbers between 0 and 255.
- HEX codes: represent values for red, green, and blue in hexadecimal code.
- Color name: Colors are represented by predefined names.
Make sure When picking foreground and background colors, there is enough contrast for the text to be legible. Opacity allows you to specify the opacity of an element and any on its child elements, the value ia a number between 0.0 and 1.0. HSL color property: the value of the property starts with the letters hsl, followed by individual values inside parentheses for HUE, saturation, lightness, and alpha.