<legend>: The Field Set Legend element

<legend> HTML 元素表示其父 <fieldset> 的内容的标题。

¥The <legend> HTML element represents a caption for the content of its parent <fieldset>.

Try it

属性

¥Attributes

该元素仅包含 全局属性

¥This element only includes the global attributes.

示例

¥Examples

有关 <legend> 的示例,请参阅 <form>

¥See <form> for examples on <legend>.

技术总结

¥Technical summary

内容类别 没有任何。
允许的内容 措辞内容headings(h1–h6 元素)。
标签遗漏 无,开始和结束标记都是强制性的。
允许的父级 一个 <fieldset>,其第一个子元素是此 <legend> 元素
隐式 ARIA 角色 没有对应的角色
允许的 ARIA 角色 不允许 role
DOM 接口 HTMLLegendElement

规范

Specification
HTML Standard
# the-legend-element

¥Specifications

浏览器兼容性

BCD tables only load in the browser

¥Browser compatibility

也可以看看

¥See also