HTML <legend> tag
Examples
Combinations form related elements:
<form>
<fieldset>
<legend>Personalia:</legend>
Name: <input type="text" size="30"><br>
Email: <input type="text" size="30"><br>
Date of birth: <input type="text" size="10">
</fieldset>
</form>
<fieldset>
<legend>Personalia:</legend>
Name: <input type="text" size="30"><br>
Email: <input type="text" size="30"><br>
Date of birth: <input type="text" size="10">
</fieldset>
</form>
try it"
Browser Support
Most browsers support <legend> tag.
Tag definitions and instructions
The <legend> element for the <fieldset> element defines the title.
Differences between HTML 4.01 and HTML5
"Align" attribute was deprecated in HTML 4.01, HTML5 does not support this property. Not recommended. Use CSS to set the alignment of the <legend> element.
Attributes
属性 | 值 | 描述 |
---|---|---|
align | top bottom left right |
HTML5 不支持。 HTML 4.01 已废弃。不建议使用。 请使用样式代替。 为 fieldset 中的标题定义对齐方式。 |
Global Properties
<legend> tag supports the global attributes, view complete the property sheet HTML Global Attributes .
Event Properties
<legend> tag supports all HTML event attributes .