Nav Element with no Heading
September 24, 2019
Last Thursday, while playing with the W3C Markup Validation Service with as input my other blog, Plurrrr, I noticed twice the following remark in the Structural outline after I had selected Show Outline as an option:
[nav element with no heading]
While this is not an error nor a warning; a nav
element has an optional
heading, I noticed that I could easily remove the bottom remark because the HTML5 I use is as follows:
<section>
<header>
<h2>Archive</h2>
</header>
<nav>
<dl class="tl-archive">
:
:
</dl>
</nav>
</section>
The definition list contains all links to the week pages, using a nested unordered list.
As you can see I do output a heading element, only not inside the nav
element but in a wrapping section
element. Because nav
is also a sectioning element this can be shortened to:
<nav class="tl-archive">
<h2>Archive</h2>
<dl>
:
:
</dl>
</nav>
Note that in order to style this I reused the class tl-archive
with a different styling.
So today, in the evening I modified in both the Perl and Python code the function html_for_archive
to no longer output the nav
element, as this element moved to the HTML template. Also the class attribute was no longer required.
Next I edited the HTML template file and the CSS file.
Finally, I bumped the version to 2.1.0 and pushed it to GitHub.