HTML and CSS Reference
In-Depth Information
Rule Sets
A rule set consists of a selector followed by a declaration block contain-
ing declarations of style properties and their values, as explained in the
following list (see also Figure 1.1 ).
Figure 1.1
The parts of
a rule set.
2
1
4
3
5
6
1.
Rule set : This is the entire definition of a CSS rule, including selector
and declaration block, containing individual declarations.
2.
Selector : The selector includes everything up to the opening curly
brace. The selector describes the markup elements to which the
contents of declaration block apply. Individual selectors may share
a declaration block, with each selector separated with a comma ( , ).
3.
Declaration block : The declaration block starts with the left curly brace
and ends with the right curly brace. Inside the block there are zero or
more declarations, each separated by a semicolon ( ; ).
3.
Declaration : Each declaration is a colon-separated property-value pair.
5.
Property : The property is the CSS property that the declaration is
targeting.
6.
Value : This is the value that will be applied to the declared property.
The syntax of the value depends on the property but can be things
such as keywords, a <length> , a <percentage> , or a mix of multiple,
space-separated types.
 
Search WWH ::




Custom Search