Skip to content

Latest commit

 

History

History
42 lines (33 loc) · 1.44 KB

File metadata and controls

42 lines (33 loc) · 1.44 KB

style your HTML with CSS

  • CSS treats each HTML element as if it appears inside its own box and uses rules to indicate how that element should look.
  • Rules are made up of selectors (that specify the elements the rule applies to) and declarations (that indicate what these elements should look like).
  • Different types of selectors allow you to target your rules at different elements.
  • Declarations are made up of two parts: the properties of the element that you want to change, and the values of those properties. For example, the font-family property sets the choice of font, and the value arial specifies Arial as the preferred typeface.
  • CSS rules usually appear in a separate document, although they may appear within an HTML page.

color with HTML

  • Color not only brings your site to life, but also helps convey the mood and evokes reactions.
  • There are three ways to specify colors in CSS: RGB values, hex codes, and color names.
  • Color pickers can help you find the color you want.
  • It is important to ensure that there is enough contrast between any text and the background color (otherwise people will not be able to read your content).
  • CSS3 has introduced an extra value for RGB colors to indicate opacity. It is known as RGBA.
  • CSS3 also allows you to specify colors as HSL values, with an optional opacity value. It is known as HSLA

Understanding Color