4 ms·
Not quite. You can do things like this, and the `section > h2` will properly be a subheading of the `section > h1`, which will be a subheading of `article > h1`
by adiabatty 10y ago
Not quite. You can do things like this, and the `section > h2` will properly be a subheading of the `section > h1`, which will be a subheading of `article > h1`:
<article>
<h1>Why Fancy Keyboards Are Great</h1>
<section>
<p>Fancy keyboards are wonderful. Here's why:</p>
<h1>Ergonomics</h1>
<p>Not contorting your body into a pretzel is wonderful.</p>
<h2>Low-force keys</h2>
<p>You can get fancy keyboards with Gateron Clears to make typing easier.</p>
...
</section>
</article>
This sort of thing is handy if your blog software (Jekyll, Hugo, etc.) mechanically pastes the output of a Markdown processor into a space reserved for blog posts. Particularly if you want to use h1 elements in your Markdown source and have things turn out right without rewriting header levels.
Like with a lot of document-markup doodads, there's an automated checker for this sort of thing: https://gsnedders.html5.org/outliner/ https://gsnedders.html5.org/outliner/