Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Skipping heading levels valid HTML 5.2?

7 views
Skip to first unread message

Osmo Saarikumpu

unread,
Mar 23, 2018, 3:52:53 AM3/23/18
to
Organizing a page using headings (Techniques for WCAG 2.0) at:

https://www.w3.org/TR/2012/NOTE-WCAG20-TECHS-20120103/G141

says:

"To facilitate navigation and understanding of overall document
structure, authors should use headings that are properly nested (e.g.,
h1 followed by h2, h2 followed by h2 or h3, h3 followed by h3 or h4,
etc.)."

And IIUC the prose at 4.3.9. Headings and sections:

https://www.w3.org/TR/html52/sections.html#headings-and-sections

would imply skipping levels as invalid also. I'm wondering if this is
correct, as the validator passes my test page (which asks also for the
outline) at:

https://validator.w3.org/nu/?showoutline=yes&useragent=Validator.nu%2FLV+http%3A%2F%2Fvalidator.w3.org%2Fservices&acceptlanguage=&doc=http%3A%2F%2Fweppipakki.com%2Fdemo%2Fheadings.htm

I understand the limitations of programmatic validation, but it would
seem something that could easily be checked.

--
Best wishes, Osmo

Jukka K. Korpela

unread,
Apr 2, 2018, 8:04:49 AM4/2/18
to
Osmo Saarikumpu wrote:

> Organizing a page using headings (Techniques for WCAG 2.0) at:
>
> https://www.w3.org/TR/2012/NOTE-WCAG20-TECHS-20120103/G141
>
> says:
>
> "To facilitate navigation and understanding of overall document
> structure, authors should use headings that are properly nested (e.g.,
> h1 followed by h2, h2 followed by h2 or h3, h3 followed by h3 or h4,
> etc.)."

That’s an accessibility recommendation, and a bit poorly formulated (we
don’t nest headings; we nest sections). It’s not relevant to validity.

Besides, even in its own context, the quoted text is a recommendation,
not a conformance requirement. It uses “should”; requirements use “shall”.

> And IIUC the prose at 4.3.9. Headings and sections:
>
> https://www.w3.org/TR/html52/sections.html#headings-and-sections
>
> would imply skipping levels as invalid also.

I cannot find a statement to that effect there.

> I'm wondering if this is
> correct, as the validator passes my test page

Your test page has a BODY element with just H1, H3, and few P elements.
I don’t see why it would be invalid. (It might be different in ISO HTML,
which was based on HTML 4.01 with strict heading level rules enforced in
an ad hoc manner. But ISO HTML was an exercise in futility.)

The “outline algorithm”, which is a rather theoretical approach
(probably not implemented except in some experimental checking
programs), creates a section that starts with the H3 element and here
extends to the end of the BODY. It does not construct an orphan
subsubheading. So what is wrong, in some sense, is just the use of H3
instead of H2 for a second-level heading.

--
Yucca, http://jkorpela.fi

Joy Beeson

unread,
Apr 3, 2018, 12:09:09 AM4/3/18
to

They are just saying that the headers should reflect the organization
of your page. If a subdivision has a higher-level header than the
section it's a part of, people are going to be confused.

It should also have said that if sections of equal priority have
headers of different levels, or if different-level sections have equal
headers, people are going to get confused.

If I have a section of third-level importance, I give it a third-level
header regardless of whether there is a second-level header.


This leaves room to divide the section into sub-sections if it gets
too long, but I've never done this. On my pages, third-level headers
are nearly always dates, and at the end of the month I start over.

--
Joy Beeson
joy beeson at comcast dot net
http://wlweather.net/PAGEJOY/


0 new messages