Smal SEO Tool

CSS Syntax

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

CSS Syntax Diagram

The selector points to the HTML element you want to style. The declaration block contains one or more declarations separated by semicolons. Each declaration includes a CSS property name and a value, separated by a colon.

Example Explained

  • h1 is a selector - it selects all `<h1>` elements on the page.
  • color: blue; is a declaration. color is the property, and `blue` is the value.
  • font-size: 12px; is another declaration. `font-size` is the property, and `12px` is the value.

Example CSS Rule

css
h1 {
  color: blue;
  font-size: 12px;
}
Try it Yourself »

Test Yourself with an Exercise

In the CSS rule 'p { color: red; }', what is 'color'?