<aside>
Try it
HTML <aside>
元素表示一个和其余页面内容几乎无关的部分,被认为是独立于该内容的一部分并且可以被单独的拆分出来而不会使整体受影响。其通常表现为侧边栏或者标注框(call-out boxes)。
The source for this interactive example is stored in a GitHub repository. If you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request.
内容分类 (en-US) | 流式元素, 章节元素, 可触摸内容. |
---|---|
允许的内容 | 流式元素. |
标签省略 | 不允许,开始标签和结束标签都不能省略。 |
允许的父元素 | 所有元素接受流式元素。注意 <aside> 不能是<address> 元素的后代 |
允许的 ARIA 角色 | feed , note , presentation , region , search |
DOM 接口 | HTMLElement |
属性
此元素只有全局属性。
使用说明
- 不要使用
<aside>
元素去尾随括号内的文本 ,因为这种文本被认为是主要流内容的一部分。
示例
<article>
<p>
迪斯尼电影<cite>海的女儿</cite>(<cite>The Little Mermaid</cite>)于 1989 年首次登上银幕。
</p>
<aside>
在首次发行期间,该片便收获了 8700 万美元的票房。
</aside>
<p>
更多有关该电影的信息…
</p>
</article>
标准
标准 | 状态 | 备注 |
---|---|---|
HTML Living Standard <aside> |
Living Standard | |
HTML5 <aside> |
Recommendation |
浏览器兼容性
BCD tables only load in the browser
参见
- Others section-related elements:
<body>
,<article>
,<section>
,<nav>
,<h1>
(en-US),<h2>
(en-US),<h3>
(en-US),<h4>
(en-US),<h5>
(en-US),<h6>
(en-US),<hgroup>
,<header>
,<footer>
,<address>
; - 使用 HTML 章节与大纲