Note that there are some explanatory texts on larger screens.

plurals
  1. POStructure a site's contents with the section elements and headings
    primarykey
    data
    text
    <p>I already know there are numerous threads outside discussing the use of section elements - I already read a lot of them and so far I came to the following conclusion:</p> <p>A &lt;section&gt; element should be used to wrap content which could be stored as an individual database record. (according to HTML5doctor) and that the heading should be <em>inside</em> the section element (although in a database I wouldn't store the heading in the same column as content...))</p> <p>So far so good, I reorganized my website's structure and had it analyzed by <a href="http://gsnedders.html5.org/outliner/" rel="nofollow">http://gsnedders.html5.org/outliner/</a> - but surprisingly it kind of ignored my h1, h2, ... headings order (somewhere I read that special elements reset the headings or so..? :S) which kinda drives me mad.</p> <p>By now I've got a structure like (skipping some div's for styling purpose):</p> <pre><code>&lt;header&gt; &lt;section&gt; h1 // title of my page --&gt; h1 &lt;/section&gt; &lt;section&gt; &lt;nav&gt;...&lt;/nav&gt; &lt;/section&gt; &lt;/header&gt; &lt;div role="main"&gt; // don't use section for your website's main content h2 // main content &lt;section&gt; h3 // main content's sub heading &lt;/section&gt; &lt;section&gt; h4 // sub heading of main content's sub heading h5 h5 &lt;/section&gt; &lt;section&gt; h3 // another main content's sub heading &lt;/section&gt; &lt;/div&gt; &lt;aside&gt; &lt;section&gt; h3 // about me &lt;/section&gt; &lt;/aside&gt; </code></pre> <p>instead of the expected outline:</p> <pre><code>title of my page navigation main content main content's sub-headings, etc. about me </code></pre> <p>I got:</p> <pre><code>main content title of my page navigation main content's sub entries about me </code></pre> <p>of course I could wrap my headings in some section elements to reset this counter, but I would never store the entire main content as a single database entry - so this would be an unsemantic usage of a semantic element, which makes the whole work somewhat redundant.</p> <p>Did I miss the point of the section element or the nested headings? Any proposals how to handle this behavior (which sounds great in theory, but in practice it seems to be behave in a strange way...)</p> <p>EDIT: I decided to stick to the "use article on elements that could be a RSS item" rule, as it makes much more sense to me and went on to use a section element to keep the main content apart from the navigation etc. (as answered below)</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.
    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