aboutsummaryrefslogtreecommitdiff
path: root/files/zh-cn/web/html/element/aside/index.html
blob: f422d04a49097620bd83ccf9781fe49da06e05cf (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
---
title: <aside>
slug: Web/HTML/Element/aside
tags:
  - HTML
  - HTML5
  - 元素
translation_of: Web/HTML/Element/aside
---
<p><span class="seoSummary"><strong>HTML <code>&lt;aside&gt;</code> 元素</strong>表示一个和其余页面内容几乎无关的部分,被认为是独立于该内容的一部分并且可以被单独的拆分出来而不会使整体受影响。</span>其通常表现为侧边栏或者标注框(call-out boxes)。</p>

<div>{{EmbedInteractiveExample("pages/tabbed/aside.html", "tabbed-standard")}}</div>

<p class="hidden">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 <a href="https://github.com/mdn/interactive-examples">https://github.com/mdn/interactive-examples </a> and send us a pull request.</p>

<table class="properties">
 <tbody>
  <tr>
   <th scope="row"><a href="/zh-CN/docs/HTML/Content_categories" title="HTML/Content_categories">内容分类</a></th>
   <td><a href="/zh-CN/docs/Web/Guide/HTML/Content_categories#流式元素(Flow_content)" title="HTML/Content categories#Flow content">流式元素</a>, <a href="/zh-CN/docs/Web/Guide/HTML/Content_categories#章节元素(Sectioning_content)">章节元素</a>, <a href="https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/Content_categories#Palpable_content">可触摸内容</a>.</td>
  </tr>
  <tr>
   <th scope="row">允许的内容</th>
   <td><a href="/zh-CN/docs/Web/Guide/HTML/Content_categories#流式元素(Flow_content)" title="HTML/Content categories#Flow content">流式元素</a>.</td>
  </tr>
  <tr>
   <th scope="row">标签省略</th>
   <td>{{no_tag_omission}}</td>
  </tr>
  <tr>
   <th scope="row">允许的父元素</th>
   <td>所有元素接受流式元素。注意 <code>&lt;aside&gt;</code> 不能是{{HTMLElement("address")}} 元素的后代</td>
  </tr>
  <tr>
   <th scope="row">允许的 ARIA 角色</th>
   <td>{{ARIARole("feed")}}, {{ARIARole("note")}}, {{ARIARole("presentation")}}, {{ARIARole("region")}}, {{ARIARole("search")}}</td>
  </tr>
  <tr>
   <th scope="row">DOM 接口</th>
   <td>{{domxref("HTMLElement")}}</td>
  </tr>
 </tbody>
</table>

<h2 id="属性">属性</h2>

<p>此元素只有<a href="https://developer.mozilla.org/zh-CN/docs/HTML/Global_attributes">全局属性</a></p>

<h2 id="使用说明">使用说明</h2>

<ul>
 <li>不要使用 <code>&lt;aside&gt;</code> 元素去尾随括号内的文本 ,因为这种文本被认为是主要流内容的一部分。</li>
</ul>

<h2 id="示例">示例</h2>

<pre class="brush: html">&lt;article&gt;
  &lt;p&gt;
    迪斯尼电影&lt;cite&gt;海的女儿&lt;/cite&gt;&lt;cite&gt;The Little Mermaid&lt;/cite&gt;)于 1989 年首次登上银幕。
  &lt;/p&gt;
  &lt;aside&gt;
    在首次发行期间,该片便收获了 8700 万美元的票房。
  &lt;/aside&gt;
  &lt;p&gt;
    更多有关该电影的信息…
  &lt;/p&gt;
&lt;/article&gt;</pre>

<p>{{EmbedLiveSample("Examples")}}</p>

<h2 id="标准">标准</h2>

<table class="standard-table" style="font-size: 14px; font-weight: normal; line-height: 1.5;">
 <thead>
  <tr>
   <th scope="col">标准</th>
   <th scope="col">状态</th>
   <th scope="col">备注</th>
  </tr>
 </thead>
 <tbody>
  <tr>
   <td>{{SpecName('HTML WHATWG', 'sections.html#the-aside-element', '&lt;aside&gt;')}}</td>
   <td>{{Spec2('HTML WHATWG')}}</td>
   <td> </td>
  </tr>
  <tr>
   <td>{{SpecName('HTML5 W3C', 'sections.html#the-aside-element', '&lt;aside&gt;')}}</td>
   <td>{{Spec2('HTML5 W3C')}}</td>
   <td> </td>
  </tr>
 </tbody>
</table>

<h2 id="浏览器兼容性">浏览器兼容性</h2>



<p>{{Compat("html.elements.aside")}}</p>

<h2 id="参见">参见</h2>

<ul>
 <li>Others section-related elements: {{HTMLElement("body")}}, {{HTMLElement("article")}}, {{HTMLElement("section")}}, {{HTMLElement("nav")}}, {{HTMLElement("h1")}}, {{HTMLElement("h2")}}, {{HTMLElement("h3")}}, {{HTMLElement("h4")}}, {{HTMLElement("h5")}}, {{HTMLElement("h6")}}, {{HTMLElement("hgroup")}}, {{HTMLElement("header")}}, {{HTMLElement("footer")}}, {{HTMLElement("address")}};</li>
 <li><a href="/zh-CN/docs/Web/Guide/HTML/Sections_and_Outlines_of_an_HTML5_document">使用 HTML 章节与大纲</a></li>
</ul>

<div>{{HTMLRef}}</div>