CSS Syntax

CSS – Syntax

The CSS syntax consists of a set of rules. These rules have 3 parts: a selector, a property, and a value.


selector { property: value }

The selector is a link between the HTML document and the style, and all HTML tags are potential selectors.


h1 { color: red }

This code tells the browser to render all occurrences of the HTML <h1> element in red.