Deprecated: mysql_connect(): The mysql extension is deprecated and will be removed in the future: use mysqli or PDO instead in /home/myscript/public_html/classes/classdb.php on line 42
Legend | Miscellaneous Elements | HTML5 Tutorial | Example

legend element



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



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.


It is applicable to all the browsers.

Ask Questions

Ask Question