<hgroup>: Das Heading Group-Element
Baseline Widely available
This feature is well established and works across many devices and browser versions. It’s been available across browsers since Juli 2015.
Das <hgroup>-Element HTML repräsentiert eine Überschrift und verwandten Inhalt. Es gruppiert ein einzelnes <h1>–<h6>-Element mit einem oder mehreren <p>.
Probieren Sie es aus
<hgroup> <h1>Frankenstein</h1> <p>Or: The Modern Prometheus</p> </hgroup> <p> Victor Frankenstein, a Swiss scientist, has a great ambition: to create intelligent life. But when his creature first stirs, he realizes he has made a monster. A monster which, abandoned by his master and shunned by everyone who sees it, follows Dr Frankenstein to the very ends of the earth. </p> hgroup { text-align: right; padding-right: 16px; border-right: 10px solid #00c8d7; } hgroup h1 { margin-bottom: 0; } hgroup p { margin: 0; font-weight: bold; } Attribute
Dieses Element umfasst nur die globalen Attribute.
Verwendungshinweise
Das <hgroup>-Element ermöglicht die Gruppierung einer Überschrift mit jeglichem sekundären Inhalt, wie z.B. Unterüberschriften, einem alternativen Titel oder einem Slogan. Jede dieser Inhaltsarten wird als <p>-Element innerhalb des <hgroup> dargestellt.
Das <hgroup> selbst hat keinen Einfluss auf die Dokumentgliederung einer Webseite. Vielmehr trägt die im <hgroup> erlaubte einzelne Überschrift zur Dokumentgliederung bei.
Beispiele
<!doctype html> <title>HTML Standard</title> <body> <hgroup id="document-title"> <h1>HTML: Living Standard</h1> <p>Last Updated 12 July 2022</p> </hgroup> <p>Some intro to the document.</p> <h2>Table of contents</h2> <ol id="toc"> … </ol> <h2>First section</h2> <p>Some intro to the first section.</p> </body> Ergebnis
Technische Zusammenfassung
| Inhaltskategorien | Flussinhalt, Überschrifteninhalt, greifbarer Inhalt. |
|---|---|
| Zulässiger Inhalt | Null oder mehr <p>-Elemente, gefolgt von einem h1, h2, h3, h4, h5, oder h6-Element, gefolgt von null oder mehr <p>-Elementen. |
| Tag-Auslassung | Keine, sowohl der Start- als auch der Endtag sind erforderlich. |
| Zulässige Eltern | Jedes Element, das Flussinhalt akzeptiert. |
| Implizite ARIA-Rolle | group |
| Zulässige ARIA-Rollen | Beliebig |
| DOM-Schnittstelle | [`HTMLElement`](/de/docs/Web/API/HTMLElement) |
Spezifikationen
| Specification |
|---|
| HTML> # the-hgroup-element> |