The hgroup
element was removed from HTML5 before it became a W3C Recommendation. And without hgroup
, you should not use a heading element for a subheading.
By using
<h1>Album Name</h1>
<h2>Artist</h2>
everything that follows would be in scope of the "Artist" heading, not the "Album Name" heading. But this would be wrong, of course.
Assuming that you publish this on a webpage that is part of a website (i.e., it contains a site-wide navigation etc.), you’ll want to use the article
element for an album. The first heading will be the heading for that section, which should be the album name. Metadata for this section can be given in the header
and footer
elements.
So an album could look like:
<main>
<article>
<header>
<h2><!-- album --></h2>
<p><!-- artist --></p>
</header>
<section>
<h3>Tracklist</h3>
<ol></ol>
</section>
</article>
</main>
(If you don’t provide any other content for a music album, you could omit the explicit "Tracklist" section/heading and directly provide the ol
as main content of that article
.)
If you’d have more metadata (like release year, country, etc.), you could use a dl
:
<header>
<h2><!-- album --></h2>
<dl>
<dt>Artist</dt> <dd><!-- artist --></dd>
<dt>Release year</dt> <dd><!-- year --></dd>
</dl>
</header>
Side note: You could use the cite
element for the album/artist/track names (exampleexample).