Consider:
p { ... } .foo { ... } #bar { ... }
What is the correct name for these statements in CSS? I\'ve seen them called selectors, rules or rule
In this example:
p.class, #id > a {
foo:bar;
}
p, #id > a
is group of selectors. p.class
and #id
are selectors. Selectors are built from simple selectors and combinators: p
is a type selector, .class
is a class selector (not a class). Combinators are '+
', '>
', '', etc.
selectors {...}
is a rule. It's a mistake to call it class.
foo:bar
is a declaration for foo
property.
http://www.w3.org/TR/CSS2/grammar.html