CSS Terminology
Posted on 2010-11-04 by Jan Vantomme
Tags:
teaching
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.
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@.
Declaration Block
A declaration block has one or more declarations and begins and ends with curly braces.
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.
!()!