Pr.Pg Next Pg

<LEGEND>..</LEGEND> tag tutorials

  • The HTML <legend> tag is used for providing a title or explanatory caption for the rest of the contents of the legend element's parent element.

  • The <legend> element can be used in conjunction with the <fieldset> elements.

  • By using the <legend> tag, you can make your forms and other elements much easier to understand for your users.

 

Syntax:

<body>

<form>

<fieldset>

<legend> group box name</legend>

</fieldset>

</form>

</body>

 

Example: HTML program to give group name using legend element

Output:
Example: HTML program to demonstrate legend for giving group box name

Output: in Chrome
Output: in Internet Explorer:
Pr.Pg border                                              Next Pg