Although I should really know this, I am afraid that I don't get it completely. Having read different articles, read books and spoke to others I still don't quite understand the correct structure for a HTML5 section
. Is it appropriate to have a h1
tag within each section
and/or article
? Does a new section
or article
constitute starting the h1
to h2
process again?
I am under the impression that each "block" should be allowed it's own "heading" structure.
For example, is this correct HTML5? :
<!doctype html>
<html>
<head>
<title>
<!-- etc. etc. -->
<body>
<section> <!-- two or more <articles> within this section, both using <h1> tags -->
<h1>Here is a section with articles in</h1>
<article>
<h1>Heading</h1>
<h2>sub heading</h2>
<p>A paragraph>
</article>
<article>
<h1>Heading</h1>
<h2>sub heading</h2>
<p>A paragraph</p>
</article>
...
</section>
<section> <!-- two or more <articles> within this additional section, both using <h1> tags -->
<h1>Here is a section with articles in</h1>
<article>
<h1>Heading</h1>
<h2>sub heading</h2>
<p>A paragraph>
</article>
<article>
<h1>Heading</h1>
<h2>sub heading</h2>
<p>A paragraph</p>
</article>
...
</section>
</body>
</html>
Since each pair of h1
and h2
elements in your article
s represents a heading and a subheading respectively, you'll need to group the pair into its own header
within the article
in order to generate a proper document outline for each article.
Besides that, the heading structures of your sections seem fine.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With