CSS Tutorial

CSS Syntax

Source: Dave Gray

CSS Syntax

Every CSS program has rules for how statements are written and executed.

  • A rule has a selector and declaration block
  • Properties end with semicolons
  • Comments use /* */

Example

CSS
body {
  background-color: #e8ebf0;
  font-family: sans-serif;
}
Try it Yourself