legend element

<Legend>

Explanation

Legend element is used to provide the "title/caption" for a form.
<fieldset style="text-align:(Left/Right/Center);"> <legend><b>Title</b></legend> Text
<br> <input type="text" /><br> </fieldset>

Example Code:

Result :

Personal Details Name

Age

DOB

Email id

Mobile No

  • User can use this tag to provide title for <figure> and <details>.
  • In HTML 4.01, <legend> is applicable only to <fieldset>.
It is available in previous versions of HTML5.
It supports both Global Attributes and Event Attributes in HTML5.

Limitations:

It is applicable to all the browsers.

Ask Questions

Ask Question