To do that, we??™d need a child selector (p. 76).
Compatibility
Selector Reference
Opera Safari Firefox Internet Explorer
9.2 3.0 2.0 1.3 2.0 1.5 1.0 7.0 6.0 5.5
Full Full Full Full Full Full Full Buggy Buggy Buggy
In Internet Explorer 5.5 and 6, this combinator doesn??™t work after a :hover
pseudo-class (p. 86).
The Ultimate CSS Reference 76
In Internet Explorer 6 and 7, if there??™s only a comment??”without any additional
whitespace??”between two simple selectors, that comment is incorrectly treated as
a descendant selector, when in fact it should fail.
Child Selector
E>F {
declaration block
}
This selector matches all elements that
are the immediate children of a
specified element. The combinator in a
child selector is a greater-than sign (>).
It may be surrounded by whitespace
characters, but if it is, Internet Explorer
5 on Windows will incorrectly treat it
as a descendant selector (p. 74). So the
best practice is to eschew whitespace
around this combinator.
Consider this HTML fragment:
Example
Here??™s an example of the child selector at
work:
ul>li {
?‹® declarations
}
This selector matches all li elements that
are the immediate children of a ul
element??”that is, all li elements that have
a ul element as a parent.
Pages:
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132