Learn moreSee full compatibilityReport feedback
尝试一下
Beagles
I love beagles so much! Like, really, a lot. They’re adorable and
their ears are so, so snugly soft!
.logo {
background: left / cover
url("/shared-assets/images/examples/puppy-header.jpg");
display: flex;
height: 120px;
align-items: center;
justify-content: center;
font:
bold calc(1em + 2 * (100vw - 120px) / 100) "Dancing Script",
fantasy;
color: #ff0083;
text-shadow: #000 2px 2px 0.2rem;
}
header > h1 {
margin-bottom: 0;
}
header > time {
font: italic 0.7rem sans-serif;
}
使用说明
否则,它是在无障碍树中的一个 section,通常包含周围部分的标题(h1 – h6 元素)和可选的副标题,但这并不是必要的。
历史用法 至
,使
属性此元素包含全局属性。
无障碍当
示例页面标题html
主页标题
结果
文章标题html
行星地球
作者:Jane Smith,发布日期:
>
我们生活在一个蓝绿相间的星球上,有许多东西还未曾见过。
结果
技术概要
内容分类
流式内容、可感知内容。
允许的内容
流式内容,但没有
标签省略
不允许,开始标签和结束标签都不能省略。
允许的父元素
任何接受流式内容的元素。请注意,
隐含的 ARIA 角色
如果是
article、aside、main、nav 或是
section
元素的后代,或者是带有
role=article、complementary、main、navigation
或
region 属性的元素的后代,则为 generic;否则为 banner。
允许的 ARIA 角色
group、presentation 或 none
DOM 接口
HTMLElement
规范SpecificationHTML # the-header-element浏览器兼容性参见
其他与章节相关的元素:
、