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

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.

内容类别 None.
准许内容 措词内容 and headings (h1–h6 elements).
Tag omission None, both the starting and ending tag are mandatory.
Permitted parents A <fieldset> whose first child is this <legend> element
Implicit ARIA role 无对应角色
Permitted ARIA roles No role permitted
DOM 接口 HTMLLegendElement

属性

此元素只包括 全局属性 .

范例

<form> for examples on <legend> .

规范

规范 状态 注释
HTML 实时标准
The definition of '<legend>' in that specification.
实时标准 Definition of the legend element
HTML5
The definition of '<legend>' in that specification.
推荐
HTML 4.01 Specification
The definition of '<legend>' in that specification.
推荐 初始定义

浏览器兼容性

The compatibility table in this page is generated from structured data. If you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. 更新 GitHub 上的兼容性数据
桌面 移动
Chrome Edge Firefox Internet Explorer Opera Safari Android webview Chrome for Android Firefox for Android Opera for Android Safari on iOS Samsung Internet
legend Chrome 完整支持 Yes Edge 完整支持 12 Firefox 完整支持 1 IE 完整支持 6 Opera 完整支持 Yes Safari 完整支持 Yes WebView Android 完整支持 Yes Chrome Android 完整支持 Yes Firefox Android 完整支持 4 Opera Android ? Safari iOS 完整支持 Yes Samsung Internet Android 完整支持 Yes

图例

完整支持

完整支持

兼容性未知 ?

兼容性未知

另请参阅

元数据

  • 最后修改: