Transition |
Meaning |
---|---|
E F |
Matches an F element that is a descendant
of an E element |
E > F |
Matches an F element that is a child of an
E element |
E + F |
Matches an F element immediately preceded
by an E element |
Building Block |
Matching Rule |
Specificity |
---|---|---|
e |
Matches any element of type e |
0-0-1 |
#myid |
Matches any element with an ID equal to myid |
1-0-0 |
.myclass |
Matches any element with class myclass |
0-1-0 |
:myclass |
Matches any element with pseudo-class myclass |
0-1-0 |
[myattr] |
Matches any element with the myattr attribute that exists and <>
null |
0-1-0 |
[myattr=”warning”] |
Matches any element whose myattr attribute value is exactly
equal to warning |
0-1-0 |
[myattr~=”warning”] |
Matches any element whose myattr attribute value is a list
of space-separated values, one of which is exactly equal to warning |
0-1-0 |
* |
Matches any element |
0-0-0 |
P.pastoral.marine { color : green ; size : 10pt ; }
<P class="pastoral marine old">
,
sets the color of the paragraph to green
,
and sets the font size to 10
.