Free Trial

Safari Books Online is a digital library providing on-demand subscription access to thousands of learning resources.

  • Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • PrintPrint
Share this Page URL
Help

3. Basic HTML Structure > Grouping Headings

Grouping Headings

Sometimes a heading has multiple consecutive levels, such as with headline subheadings, alternative titles, or tag lines. Grouping them in an hgroup element indicates they are related Image. Each hgroup may contain only two or more h1h6 headings; no other elements are allowed.

Image Two related headings are grouped together. In this example, the h2 is a subheading of the article’s h1 headline. Because it’s marked up with the highest-ranking heading, only “Giraffe Escapes from Zoo” appears in the document outline, but both display in the browser, as expected Image. Similarly, if a second h1 appeared after it in the hgroup, it would be omitted from the outline just like the h2. Also, since the h2 doesn’t appear in the outline, the next heading in the article could be h2 (rather than h3) and be understood to be a direct subheading of the h1, “Giraffe Escapes from Zoo.”


  

You are currently reading a PREVIEW of this book.

                                                                                                                    

Get instant access to over $1 million worth of books and videos.

  

Start a Free 10-Day Trial


  
  • Safari Books Online
  • Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • PrintPrint