-
Notifications
You must be signed in to change notification settings - Fork 143
Misleading usage notes for Heading elements #3652
Comments
The guidance in MDN about not using more than one In order to handle multiple Therefore, the MDN article contains that warning against using multiple It’s true that — despite all the above being the case — the HTML spec still contains examples that show using multiple In the mean time, MDN continues to contain a warning about not using multiple See https://developer.paciellogroup.com/blog/2013/10/html5-document-outline/ for a more-detailed explanation. |
Ok makes sense, that there is no outline algorithm for sectioning elements. Thank you for enlightening. What? W3C HTML checker emits a warning for any documents that have more then one I just dont understand what is wrong for user with these kind of outline. <title>Travel agency</title>
<h1>Greece</h1>
<h2>Interesting places</h2>
<h2>Weather</h2>
<h1>Thailand</h1>
<h2>Interesting places</h2>
<h3>Land</h3>
<h3>See</h3> There should not be any limitation of how many |
So in the case, what is the actual overall top-level heading for the entire page? What is that page about? What do each of the Greece, Thailand, etc., subsections relate to? As far as I can see, that page doesn’t have an overall top-level heading that indicates how the subsections are related to each other. So that’s potentially confusing for someone visiting the page for the first time — and especially potentially confusing to screen-reader users. To be clear about one thing: The So because the above example lacks any rendered document title — it lacks an overall top-level heading — I think most web markup practitioners would say that is not best-practice. Best practice would be to add a single overall top-level heading/title for the document; for example: <h1>Popular travel destinations</h1>
<h2>Greece</h2>
<h3>Interesting places</h3>
...
<h2>Thailand</h2>
<h3>Interesting places</h3>
... |
I my case there is no actual overall top-level heading. Page title is in What I am telling is that on same pages more than one If only one |
It’s worth noting the MDN article language cited in the issue description doesn’t say, You must never use more than one h1 per page. Instead that statement very intentionally uses the word should and mentions best practice. So that wording as currently written already allows for the possibility that there are some cases when it might make sense for a page to have more than one h1 element — and there are some developers who know very well what they are doing and who can choose to use more than h1 per page when that makes sense to them. But the article is attempting to give guidance to developers who don’t necessarily know quite a well what they are doing — and that’s why they are coming to MDN; they are looking for guidance about what common best practices for using headings. And so, the MDN article is optimized for that kind of developer — it’s written for the common case. It’s intended to help developers avoid inadvertently making a mistake due to lack of basic understanding of how h1-h6 headings are meant to be used hierarchically to structure a page — and that in most cases, it makes sense for every page to have a single top-level heading that tells readers: This page overall is about foo, where foo is the topic of the page overall. |
Understood. Thank you for clarification. I am closing this issue. |
Request type
Details
https://developer.mozilla.org/en-US/docs/Web/HTML/Element/Heading_Elements
In Usage notes for Heading elements is
https://html.spec.whatwg.org/#the-h1,-h2,-h3,-h4,-h5,-and-h6-elements look at first example
it makes more sense then only one
<h1>
on page. In development if you have independent component is impossible to achieve proper heading levels, because you dont know where the component will be nested.Even example is missleading
because title of book is in
<title>
element not in<h1>
element.The text was updated successfully, but these errors were encountered: