CSS Tutorial

CSS Syntax

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

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