試一試
<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;
}
屬性
此元素僅包含全域性屬性。
用法說明
<hgroup> 元素允許將標題與任何輔助內容分組,例如副標題、替代標題或標語。這些型別的內容中的每一種都表示為 <hgroup> 中的 <p> 元素。
<hgroup> 本身對網頁的文件大綱沒有影響。相反,<hgroup> 中允許的單個標題會影響文件大綱。
示例
html
<!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>
結果
技術摘要
規範
| 規範 |
|---|
| HTML # the-hgroup-element |
瀏覽器相容性
載入中…