HTML <legend> Tag


The <legend> HTML element is used to create the title of a group of form elements, which is defined using the <fieldset>. A group of elements is indicated in the browser with a frame, and the text that is located inside the <legend> container is embedded in this frame.


Permitted Parents
A <fieldset> whose first child is this <legend> element
Inline and text
Start/End Tags
Start tag: required, End tag: required


<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" />


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

Browser Support

The following table will show you the current browser support for the HTML <legend> tag.

Edge Chrome Firefox Opera Safari
Tablets / Mobile
Chrome Firefox Opera Safari Samsung Webview

Last updated by CSSPortal on: 30th September 2023