HTML and CSS Reference
In-Depth Information
-
iCLE
art
-
iCLE
art
-
Tion
sec
-
Tion
sec
P
P
P
P
<article>
<p></p>
<p></p>
<section>
<p></p>
<p></p>
</section>
</article>
article p {}
article > p {}
A space is the
descendant combina-
tor, selecting any p
that is a descendant
of an article element.
The greater-than
symbol is the child
combinator, selecting
only the p elements
that are direct chil-
dren of an article .
First we'll look at the adjacent sibling combinator. It was introduced
in CSS2.1, but it isn't supported by IE6 or 7 and so hasn't been widely used.
It selects an element that immediately follows another element.
THE ADJACENT-SIBLING COMBINATOR
Rather than use tree diagrams to illustrate the
new selectors, we'll use this simple document:
<header>
<h1>Header</h1>
</header>
<article>
<h1>Article</h1>
<p>Paragraph 1</p>
<p>Paragraph 2</p>
<footer>Article footer</footer>
</article>
<footer>
Body footer
</footer>
Search WWH ::




Custom Search