WEB DEVELOPER SITE
HTMLCSSJAVASCRIPTSQLPHPBOOTSTRAPJQUERYANGULARXML
 

HTML <legend> Tag


Example

Group related elements in a form:

<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 yourself »

Definition and Usage

The "align" attribute has been deprecated in HTML 4.01 and is not supported in HTML5. Not recommended for use. Please use CSS to set <legend>The alignment of the elements.


Browser Support

Element
<legend> Yes Yes Yes Yes Yes Yes

Differences Between HTML 4.01 and HTML5

The "align" attribute is not supported in HTML5.


Attributes

Attribute Value Description
align top
bottom
left
right
Not supported in HTML5.
Specifies the alignment of the caption