HTML <legend> Tag


The <legend> tag is used for labelling the fieldset element. By using the fieldset tag and the <legend> tag, you can make your forms much easier to understand for your users. The <fieldset> tag is used to group the form elements whilst the <legend> tag provides a label for the fieldset.

Example Code:
    <legend>Personal Information:</legend>
    Name: <input type="text" size="30" /><br />
    Email: <input type="text" size="30" /><br />
    Date of birth: <input type="text" size="10" />
Personal Information: Name:
Date of birth:
Attribute Definition
align For alignment. Top, left, top, bottom. This attribute is deprecated
Global Attributes:

The <legend> tag also supports the Global Attributes in HTML5

Event Attributes:

The <legend> tag also supports the Event Attributes in HTML5