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
|
---
title: <legend>
slug: Web/HTML/Element/legend
tags:
- Element
- HTML
- HTML 表单
- 元素
- 参考
- 表单
translation_of: Web/HTML/Element/legend
---
<p>{{HTMLRef}}</p>
<p><strong>HTML <legend></strong> 元素用于表示其父元素 {{HTMLElement("fieldset")}} 的内容标题。</p>
<p>{{EmbedInteractiveExample("pages/tabbed/legend.html", "tabbed-standard")}}</p>
<table class="properties">
<tbody>
<tr>
<th scope="row"><a href="/en-US/docs/HTML/Content_categories">内容分类</a></th>
<td>无。</td>
</tr>
<tr>
<th scope="row">允许的内容</th>
<td><a href="https://developer.mozilla.org/zh-CN/docs/Web/Guide/HTML/Content_categories#Phrasing_content" title="HTML/Content_categories#Phrasing_content">语句内容(Phrasing content</a>)。</td>
</tr>
<tr>
<th scope="row">标签忽略</th>
<td>{{no_tag_omission}}</td>
</tr>
<tr>
<th scope="row">允许的父元素</th>
<td>{{HTMLElement("fieldset")}} ,并且<code><legend></code>作为第一个子元素</td>
</tr>
<tr>
<th scope="row">Implicit ARIA role</th>
<td><a href="https://www.w3.org/TR/html-aria/#dfn-no-corresponding-role">No corresponding role</a></td>
</tr>
<tr>
<th scope="row">Permitted ARIA roles</th>
<td>No <code>role</code> permitted</td>
</tr>
<tr>
<th scope="row">DOM 接口</th>
<td>{{domxref("HTMLLegendElement")}}</td>
</tr>
</tbody>
</table>
<h2 id="属性"><span style="">属性</span></h2>
<p><br>
<span style="line-height: 21px;">这个元素只有</span><a href="https://developer.mozilla.org/zh-CN/docs/Web/HTML/Global_attributes" style="line-height: 21px;" title="HTML/Global attributes">全局属性</a>。</p>
<h2 id="示例">示例</h2>
<p>在 {{HTMLElement("form")}} 中查看关于 <code><legend></code> 元素的示例。</p>
<h2 id="Specifications" name="Specifications">规范</h2>
<table class="standard-table">
<thead>
<tr>
<th scope="col">规范</th>
<th scope="col">状态</th>
<th scope="col">注释</th>
</tr>
</thead>
<tbody>
<tr>
<td>{{SpecName("HTML WHATWG", "forms.html#the-legend-element", "<legend>")}}</td>
<td>{{Spec2("HTML WHATWG")}}</td>
<td>Definition of the <code>legend</code> element</td>
</tr>
<tr>
<td>{{SpecName("HTML5 W3C", "sec-forms.html#the-legend-element", "<legend>")}}</td>
<td>{{Spec2("HTML5 W3C")}}</td>
<td></td>
</tr>
<tr>
<td>{{SpecName("HTML4.01", "interact/forms.html#h-17.10", "<legend>")}}</td>
<td>{{Spec2("HTML4.01")}}</td>
<td>Initial definition</td>
</tr>
</tbody>
</table>
<h2 id="浏览器兼容">浏览器兼容</h2>
<p>{{Compat("html.elements.legend")}}</p>
<h2 id="另请参阅"><span style="">另请参阅</span></h2>
<div id="compat-mobile"></div>
<ul>
<li>其他与表单相关的元素:{{HTMLElement("form")}}, {{HTMLElement("option")}}, {{HTMLElement("label")}}, {{HTMLElement("button")}}, {{HTMLElement("select")}}, {{HTMLElement("datalist")}}, {{HTMLElement("optgroup")}}, {{HTMLElement("fieldset")}}, {{HTMLElement("textarea")}}, {{HTMLElement("keygen")}}, {{HTMLElement("input")}}, {{HTMLElement("output")}}, {{HTMLElement("progress")}} 和 {{HTMLElement("meter")}}。</li>
<li><a href="https://developer.mozilla.org/en-US/docs/Web/Accessibility/ARIA/Roles/Form_Role">ARIA: Form role</a></li>
</ul>
|