Note that there are some explanatory texts on larger screens.

plurals
  1. POHTML5 section tag meanings?
    primarykey
    data
    text
    <p><strong>I know</strong> there are tons of questions about this topic but I can't find an authoritative source for the answer.</p> <p>This is the <a href="http://www.w3.org/TR/html5/sections.html#the-section-element" rel="nofollow noreferrer">official definition</a> and the <a href="http://www.w3.org/wiki/HTML/Elements/section" rel="nofollow noreferrer">wiki page</a>, and there there is <a href="http://www.w3.org/TR/html5/sections.html" rel="nofollow noreferrer">more documentation</a>, but there they don't explain the correct usage if not in a very simple examples or in different ways.</p> <p><strong>What I've "understood" so far:</strong> </p> <p><code>&lt;section&gt;</code> defines a part(section) of the page, like blogrolls, headlines news, blog entries list, comments list, and everything which can be with a common topic.</p> <p><code>&lt;article&gt;</code> defines a content which has sense estranged from the rest of the page (?) and which has a single topic (blog entry, comment, article, etc).</p> <p><strong>But</strong>, inside an <code>&lt;article&gt;</code>, we can split parts of it in sections using <code>&lt;section&gt;</code>, and in this case it has the function of container to mark chapters of a bigger text.</p> <p><br></p> <h2>The doubt</h2> <p>If these sentences are correct (or partially correct) that means that <code>&lt;section&gt;</code> has two completly different usage cases.</p> <p>We could have a page written in this way:</p> <pre><code>&lt;!DOCTYPE html&gt; &lt;html lang=en&gt; &lt;head&gt; &lt;meta charset=utf-8&gt; &lt;title&gt;Fruits&lt;/title&gt; &lt;/head&gt; &lt;body&gt; &lt;h1&gt;Fruits war blog&lt;/h1&gt; &lt;section id="headlineNews"&gt; &lt;!-- USED AS CONTAINER --&gt; &lt;h1&gt;What's new about fruits?&lt;/h1&gt; &lt;article&gt;&lt;h1&gt;Apples are the best&lt;/h1&gt;Apples are better than bananas&lt;/article&gt; &lt;article&gt;&lt;h1&gt;Apple's cakes&lt;/h1&gt;With apples you can prepare a cake&lt;/article&gt; &lt;/section&gt; &lt;section id="blogEntries"&gt; &lt;!-- USED AS CONTAINER --&gt; &lt;h1&gt;Articles about fruits&lt;/h1&gt; &lt;article&gt; &lt;h1&gt;Apples vs Bananas&lt;/h1&gt; &lt;section&gt; &lt;!-- USED AS CHAPTER --&gt; &lt;h2&gt;Introduction:&lt;/h2&gt; Bananas have always leaded the world but... &lt;/section&gt; &lt;section&gt; &lt;!-- USED AS CHAPTER --&gt; &lt;h2&gt;The question:&lt;/h2&gt; Who is the best? We don't know so much about apples... &lt;/section&gt; &lt;/article&gt; &lt;/section&gt; &lt;/body&gt; &lt;/html&gt; </code></pre> <p>And this is how looks the Outline: </p> <pre><code>1. Fruits war blog 1. What's new about fruits? 1. Apples are the best 2. Apple's cakes 2. Articles about fruits 1. Apples vs Bananas 1. Introduction: 2. The question: </code></pre> <p>So the <code>&lt;section&gt;</code> is thought with two <strong>completly</strong> different and not related semantic meanings? </p> <p>Is it correct use:</p> <pre><code>&lt;!-- MY DOUBT --&gt; &lt;section&gt; &lt;!-- USED AS CONTAINER --&gt; &lt;article&gt; &lt;section&gt;&lt;/section&gt; &lt;!-- USED AS CHAPTER --&gt; &lt;/article&gt; &lt;/section&gt; </code></pre> <p>in this neasted way?<br> I've found that <a href="http://www.w3.org/TR/html5/sections.html#article-example" rel="nofollow noreferrer">is possible</a> to use in the inversed way:</p> <pre><code>&lt;!-- FROM W3C --&gt; &lt;article&gt; &lt;!-- BLOG ENTRY --&gt; &lt;section&gt; &lt;!-- USED AS CHAPTER ABOUT COMMENTS --&gt; &lt;article&gt;&lt;/article&gt; &lt;!-- COMMENT --&gt; &lt;/section&gt; &lt;/article&gt; </code></pre> <p>But I can't find an answer to the way I've written below.</p> <p>I guess read the discussion where the W3C group has wrote the basis of the <code>&lt;section&gt;</code> tag could be useful but I can't find it.</p> <p><strong>N.B. I'm looking for replies documented with authorative sources</strong></p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload