How to properly use h1 in HTML5?


 h1 is a heading and not a title. Youcan gives own heading element to each sectioning element. h1 cannot be the title. It can be the heading of that particular section of the page. Each article can have its own title. <h1> defines the most important heading. The first <h1> element is considered the label for the entire document. 

It is perfectly fine to use as many <h1> tags as your document calls for; that is one per sectioning root or content section. Use one set of <h1> tags per sectioning root or content section. There should always be an <h1> level heading between the opening <body> tag and the first content section, to label the overall document.

Example

<body>
   <h1>Heading 1</h1>
   <p>My content </p>
   <h2>Heading of a subsection</h2>
   <p>My content </p>
   <h2>Another subsection </h2>
   <p>content</p>
<body>

Updated on: 04-Mar-2020

204 Views

Kickstart Your Career

Get certified by completing the course

Get Started
Advertisements