CSS Terminology

Posted by Jan Vantomme on 04 November 2010.
Tags: ,

If you want to learn CSS, there is some terminology you need to know about. Knowing the different parts of a CSS rule and the CSS syntax will make it easier to fix problems when you run into validation errors.

CSS Rule

A CSS rule is a block of code that styles an html element. The CSS rule below sets is used to style the body element of our page. A rule is made up of selectors and declarations.

A CSS Rule

Selector

A rule starts with a selector that corresponds to the html element you want to style. If you want to style the body element, your selector will start with @body@.

A CSS Selector

Declaration Block

A declaration block has one or more declarations and begins and ends with curly braces.

A CSS Declaration Block

Declaration

Each declaration has a property and a value, separated by a colon and ends with a semicolon. Properties usually don’t have spaces. If a property is made out of two words, these words are separated with a hyphen.

A CSS Declaration

!()!

Property

A CSS Property

Value

A CSS Value

Tweet this article