Skip to main content

Common CSS Properties

  1. color - This changes the color of the text within the selected elements
  • Valid values can be in hex, rgb, or HTML color codes
  1. text-align - Align the text of block-level elements
  • Values can be left, right, center, or justify
  1. text-decoration - Extra lines around your text
  • Values can be none, underline, overline, strikethough
  • Usually used to remove underline from links (<a>)
  1. font-family - Specify the font for a selected element
  • Examples: serif, sans-serif, cursive
  1. font-weight - Change font of element to be bold or less bold
  • Values: lighter, normal, bold, bolder
  1. font-size - change the font size of text within an element
  2. background-color - Set the background color of an element
  3. background-image - Set the background of an element to an image
  • Value must be in form: url("image.png") where image.png is the path to the image desired in the background
  1. margin - add space between an element and it's surroundings
  • Values in px or any spacial unit

CSS properties and values can go on forever. Don't worry about memorizing them all.

Here's a good place to start.

Here's a semi-exhaustive list.

Let's head into an exercise.