webmaker_logo

Cheatsheet

CSS

Dive into CSS

n is used to indicate where a number can be used. Don't forget to add a "%" or "px" after the number. Remember to use American spellings.

  1. CSS Syntax
    selector {
      property: value;
    }
  2. Color
    Uses one of 147 color names or a hexadecimal. selector {
      color: red;
      background-color: #ff0000; }
  3. Background
    selector {
      background-image: url(http://thisisanimage.jpg);
      background-position: top left;
    top center;
    top right;
    center left;
    center center;
    center right;
    bottom left;
    bottom center;
    bottom right;
    n n;
      background-repeat: repeat;
    repeat-x;
    repeat-y;
    no-repeat;
    }
  4. Text
    selector {
      font-family: Font Name;
      font-size: n;
      font-style: normal;
    italic;
    oblique;
      font-weight: lighter;
    normal;
    bold;
    bolder;
      line-height: normal;
    n;
      letter-spacing: normal;
    n;
      text-align: left;
    right;
    center;
    justify;
      text-decoration: none;
    underline;
    line-through;
      text-transform: none;
    capitalize;
    uppercase;
    lowercase;
    }