总结
HTML的<legend>元素(也称为HTML的域说明元素(or HMTL
Legend Field Element))代表一个用于表示它的父元素<fieldset>的内容的标题。
- 内容分类无。
- 允许的内容 语句内容(Phrasing content)。
- 标签省略不允许省略,开始标签和结束标签都是必需的。
- 允许的父元素
<fieldset>,并且<legend>作为第一个子元素 - DOM 接口
HTMLLegendElement
属性
这个元素只有全局属性。
示例
<form> 元素说明中关于 <legend>元素的例子.
规范
| Specification | Status | Comment |
|---|---|---|
| WHATWG HTML Living Standard <legend> |
Living Standard | Definition of the legend element |
| WHATWG HTML Living Standard | Living Standard | Suggested default rendering of the fieldset and legend elements |
| HTML5 <legend> |
Candidate Recommendation | |
| HTML 4.01 Specification <legend> |
Recommendation | (link) |
浏览器兼容
| Feature | Chrome | Firefox (Gecko) | Internet Explorer | Opera | Safari |
|---|---|---|---|---|---|
| Basic support | (Yes) | 1.0 (1.7 or earlier) | (Yes) | (Yes) | (Yes) |
| Feature | Android | Firefox Mobile (Gecko) | IE Mobile | Opera Mobile | Safari Mobile |
|---|---|---|---|---|---|
| Basic support | (Yes) | 1.0 (1.0) | (Yes) | (Yes) | (Yes) |
另请参阅
- Others form-related elements:
<form>,<option>,<label>,<button>,<select>,<datalist>,<optgroup>,<fieldset>,<textarea>,<keygen>,<input>,<output>,<progress>and<meter>.