Is using of multiple <h1> tag in a page a good practice? | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
+ 1

Is using of multiple <h1> tag in a page a good practice?

What if use multiple <h1> tag in a page? If I need to do it.

16th Jun 2023, 7:27 AM
Fabian Roy
Fabian Roy - avatar
5 Answers
+ 6
Fabian Roy It is not a good practice to use multiple `<h1>` tags on a single page because the `<h1>` tag is typically used to indicate the main heading of a page and should only appear once. Using multiple `<h1>` tags can confuse search engines and screen readers, as they rely on the hierarchy of headings to determine the structure of the page. If you need to use multiple headings on a page, you should use the appropriate heading level to indicate the hierarchy of the content. For example, you can use `<h2>` for subheadings and `<h3>` for sub-subheadings. This will help to ensure that the structure of your page is clear and easy to understand for both users and search engines.
16th Jun 2023, 7:36 AM
Darpan kesharwani🇮🇳[Inactive📚]
Darpan kesharwani🇮🇳[Inactive📚] - avatar
+ 3
Have a look at the documentation: https://developer.mozilla.org/en-US/docs/Web/HTML/Element/Heading_Elements It is good practice to use only h1 element per page. If you use more than one h1, nothing special will happen. Why do you think you "need to" use multiple h1?
16th Jun 2023, 7:35 AM
Lisa
Lisa - avatar
+ 1
Technically, it is recommended to use <h1> tags only when it is necessary, and handle the rest of the text, by doing some styling to a paragraph, or other text display method. You can use the <h1> tag, for example to set a welcoming message in your homepage, and handle the rest of the texts, by adding some other text methods, and styling them, to regulate their font or to further style them, by adding classes and ids. You should also, use the other heading tags carefully, as the same rule applies to them. Hope this helps.
16th Jun 2023, 2:58 PM
Danish Zubair
Danish Zubair - avatar
+ 1
It depends If a page is just like one article, you should use one <h1> But if you have like <section> and <articles> that might be better with it , you can use it for sure
16th Jun 2023, 3:54 PM
Cool-Coder
Cool-Coder - avatar
0
Heading levels need to be used in the correct order (h1, h2, …h6). Drag and drop to rearrange the code After your h1 you can use as many h2s as you need, after each h2 you can include h3s, and so on.
8th Mar 2024, 12:27 PM
Yaswanth K
Yaswanth K - avatar