Coding With Fun
Home Docker Django Node.js Articles Python pip guide FAQ Policy

HTML <legend> tag


May 04, 2021 HTML Reference Manual


Table of contents


HTML and legend. Tags

In HTML, we can group the information about a form, and the label can be used to combine the relevant elements of the form, representing the title of its parent, the content.

To combine related elements in a form:

<form>
<fieldset>
<legend>个人信息:</legend>
姓名: <input type="text" size="30"><br>
邮箱: <input type="text" size="30"><br>
生日: <input type="text" size="10">
</fieldset>
</form>

Try it out . . .

Browser support

HTML <legend> tag HTML <legend> tag HTML <legend> tag HTML <legend> tag HTML <legend> tag

Most browsers currently support the hashtag.


Label definition and instructions for use

The element defines the title for the element.


The difference between HTML 4.01 and HTML5

The "align" property has been discarded in HTML 4.01 and is not supported by HTML5. N ot recommended. Use CSS to set the alignment of the elements.


Property

属性 描述
align top
bottom
left
right
HTML5 不支持。 HTML 4.01 已废弃。不建议使用。 请使用样式代替。为 fieldset 中的标题定义对齐方式。


Global properties

The label supports global properties and views the full property sheet HTML global properties.


The event property

The tag supports all HTML event properties.


Related properties

HTML DOM Reference Manual: HTML DOM Legend Object