CSS Tutorial

The language for styling web pages.

CSS Syntax

CSS Syntax

A CSS rule consists of a selector and a declaration block.

selector { property: value; }

Parts of CSS Rule:

  • Selector - points to the HTML element
  • Property - the style attribute (color, font-size...)
  • Value - the value of the property
  • Declaration - property + value pair

Try It Yourself

Edit the code below and click Run to see the result live.

Source Code
Result
Topics