HTML and CSS Reference
In-Depth Information
<header>
<h1>Header</h1>
</header>
<article>
<h1>Article</h1>
<p>Paragraph 1</p>
<p>Paragraph 2</p>
<blockquote>Quote</
blockquote>
<p>Paragraph 3</p>
</article>
<footer>
Body footer
</footer>
For this set of examples, we'll
make a slight modification to the
HTML . Instead of an article
footer, a blockquote element and a
third paragraph have been
added.
+
~
1.0
1.0
1.0
1.0
Elements targeted by the general-
sibling combinator have to occur
after the elements targeted by the
preceding selector in the document.
Compare the results of these two
rules. There are three paragraphs
after the h1 , but only one of those is
after the blockquote .
7.0
8.0
6.0
9.5
1.0
1.0
h1 ~ p {
background-color: #000;
}
blockquote ~ p {
background-color: #000;
}
Listing: ch07/sibling-combinator-1b.html
Listing ch07/sibling-combinator-1c.html
 
Search WWH ::




Custom Search