Javatpoint Logo
Javatpoint Logo

HTML <legend> tag

HTML <legend> tag is used to insert a title or caption to its parent element such as <fieldset>. The <legend> element must be the first child of <fieldset > element.

By using <legend> tag with <form> elements, it is easy to understand the purpose of grouped form elements.


Following are some specifications about the HTML <legend> tag

Display block
Start tag/End tag Both Start and End tag
Usage textual


Test it Now


HTML legend tag


Tag-specific attributes:

Attribute Value Description
  • top
  • bottom
  • left
  • right
It specifies the alignment of the caption.
(Not Supported in HTML5)

Global attribute:

The <legend > tag supports the global attributes in HTML

Event attribute:

The <legend> tag supports the event attributes in HTML.

Supporting Browsers

Elementchrome browser Chromeie browser IEfirefox browser Firefoxopera browser Operasafari browser Safari
Next TopicHTML lists

Youtube For Videos Join Our Youtube Channel: Join Now


Help Others, Please Share

facebook twitter pinterest

Learn Latest Tutorials


Trending Technologies

B.Tech / MCA