Reference lesson

CSS Syntax

Write selectors and declaration blocks.

About 8 minutes

What you’ll learn

A selector chooses elements. Each declaration pairs a property with a value. The cascade decides which matching declaration wins.

Try it yourself

Press Ctrl/Cmd + Enter to run.