Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Using multiple h1 tag in a page #10138

Closed
bhojpress opened this issue Feb 15, 2024 · 1 comment
Closed

Using multiple h1 tag in a page #10138

bhojpress opened this issue Feb 15, 2024 · 1 comment

Comments

@bhojpress
Copy link

bhojpress commented Feb 15, 2024

I am in a serious dilemma about using multiple h1 tag in a single page. With the intro to HTML5, multiple h1 tag was allowed but now I heard it's been revoked?

I have drafts page where I couldn't think except using multiple h1 tag. Let me explain it why:

Landing in /drafts: (Representation of UI)

+------------------------------------------------------------------+
| Personal drafts (heading)                                                                      |
+------------------------------------------------------------------+
|   Search...                                       |                                                        |
|   My draft title 1                              |                                                        |
|   My draft title 2                             |                                                         |
|   My draft title 3                             |                                                         |
|   My draft title 4                             |                                                         |
|   My draft title 5                             |                                                         |
+-------------------------------------------------------------------+

Landing in /drafts/my-draft-title-1:

+-------------------------------------------------------------------+
| Personal drafts (heading)                                                                       |
+-------------------------------------------------------------------+
|   Search...                                       |   My draft title 1 (heading).            |
|   My draft title 1                              |   --------------------------------|
|   My draft title 2                             |    Article contents...                       |
|   My draft title 3                             |                                                         |
|   My draft title 4                             |                                                         |
|   My draft title 5                             |                                                         |
+-------------------------------------------------------------------+

Key points:

  • When visitors land on /drafts it's perfectly fine to have h1 tag: Personal drafts
  • When visitors land on /drafts/articles-of-the-draft, generally h1 tag should be: Article of the draft (SEO wise)
  • Looking at this layout scenario, having both title as h1 tag is perfectly valid in my opinion.
  • If we plan to use h1 for "Personal drafts" and h2 for "Article of the draft", then I feel it really a bad approach. Search results: "Personal drafts" for all articles as highlighting with h1 tag.
  • To consider the "Article of the draft" as h1 tag, we need to replace heading from "Personal draft" to a div or paragraph. But this will hamper semantic usages between page switch between /drafts and /drafts/post
  • Thus, personally, I was having a strong feeling of correct usage of multiple h1 tag in the page like:
<article>
  <h1>Personal drafts</h1>
  <div>
     ...
     <div>
        <header>
             <h1>Article of the draft</h1>
             ...
        </header>
     </div>
    ...
  </div>
</article>

Now, outlining this, we could simply state that this is "Personal drafts | Article of the draft" and perfectly valid for whatsoever reasons, in my opinion at least.

But many articles suggests that we must not use multiple h1 tag in a page and also HTML standard does not allow using multiple h1 tag in the page.

Thus, I would like to request, if it is revoked, then please set it as allowed HTML standard as there could be many reason to have multiple h1 tag semantically correct. Sometimes even many h1 tags with same level of outlines are needed where each outline will hold nested h2, h3, ... tags. And also SEARCH ENGINEs should adapt to accept the hierarchy of the headings even with same header tag as they could represent the outlines of the page with different flavors with same intentional level of emotion or attitude or say UI/UX.

Thanks,
Bhojendra Rauniyar

@domenic
Copy link
Member

domenic commented Feb 16, 2024

This does not appear to be a bug report with the HTML Standard, but instead a question about how to write HTML. As such, this issue tracker is not the right place for it; we suggest sites like https://stackoverflow.com/.

@domenic domenic closed this as completed Feb 16, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

2 participants