Short URL: http://html5.org/r/6704
| SVN | Bug | Comment | Time (UTC) |
|---|---|---|---|
| 6704 | 14058 | Tweak some text and add an example to try to clarify some confusion. | 2011-10-19 22:42 |
Index: source
===================================================================
--- source (revision 6703)
+++ source (revision 6704)
@@ -17873,9 +17873,9 @@
<p class="note" id="use-div-for-wrappers">The <code>section</code>
element is not a generic container element. When an element is
- needed for styling purposes or as a convenience for scripting,
- authors are encouraged to use the <code>div</code> element
- instead. A general rule is that the <code>section</code> element is
+ needed only for styling purposes or as a convenience for scripting,
+ authors are encouraged to use the <code>div</code> element instead.
+ A general rule is that the <code>section</code> element is
appropriate only if the element's contents would be listed
explicitly in the document's <span>outline</span>.</p>
@@ -17961,8 +17961,57 @@
</div>
+ <div class="example">
+ <p>In this example, a book author has marked up some sections as
+ chapters and some as appendices, and uses CSS to style the headers
+ in these two classes of section differently. The whole book is
+ wrapped in an <code>article</code> element as part of an even
+ larger document containing other books.</p>
+ <pre><article class="book">
+ <style>
+ section { border: double medium; margin: 2em; }
+ section.chapter h1 { font: 2em Roboto, Helvetica Neue, sans-serif; }
+ section.appendix h1 { font: small-caps 2em Roboto, Helvetica Neue, sans-serif; }
+ </style>
+ <header>
+ <hgroup>
+ <h1>My Book</h1>
+ <h2>A sample with not much content</h2>
+ </hgroup>
+ <p><small>Published by Dummy Publicorp Ltd.</small></p>
+ </header>
+ <section class="chapter">
+ <h1>My First Chapter</h1>
+ <p>This is the first of my chapters. It doesn't say much.</p>
+ <p>But it has two paragraphs!</p>
+ </section>
+ <section class="chapter">
+ <h1>It Continutes: The Second Chapter</h1>
+ <p>Bla dee bla, dee bla dee bla. Boom.</p>
+ </section>
+ <section class="chapter">
+ <h1>Chapter Three: A Further Example</h1>
+ <p>It's not like a battle between brightness and earthtones would go
+ unnoticed.</p>
+ <p>But it might ruin my story.</p>
+ </section>
+ <section class="appendix">
+ <h1>Appendix A: Overview of Examples</h1>
+ <p>These are demonstrations.</p>
+ </section>
+ <section class="appendix">
+ <h1>Appendix B: Some Closing Remarks</h1>
+ <p>Hopefully this long example shows that you <em>can</em> style
+ sections, so long as they are used to indicate actual sections.</p>
+ </section>
+</article></pre>
+
+ </div>
+
+
+
<h4>The <dfn><code>nav</code></dfn> element</h4>
<dl class="element">