In this tutorial you will learn about the <legend> tag of the HTML. This tag is used for adding the caption on the frameset.
In this tutorial you will learn about the <legend> tag of the HTML. This tag is used for adding the caption on the frameset.In this tutorial, you will see the use of legend tag. The legend tag is used for adding title or caption of frameset. The frameset is used for grouping related controls of form. A frameset looks like a box. A legend tag is a pair tag, it must have both start tag and end tag. It can be use after fieldset start tag.
Declaration Syntax :<legend> Content of caption </legend > |
<!DOCTYPE html > <html> <head> <title>Title of document</title> </head><body> <h2>Implementation of label tag of HTML5.</h2> <form id="from1"><table style="width: 49%"> <tr><td><fieldset > <legend>Student Information</legend> StudName<input type="text" ><br> StudAddress<input type="text" ></fieldset></td></tr> <tr><td > </td></tr> <tr><td > <fieldset><legend>Employee Details</legend> EmpName<input type="text" ><br> EmpAddress<input type="text" > </fieldset></td> </tr> </table> </form></body> </html> |
The legend tag is available in both HTML5 and HTML4.01. But in html5 it can be use in <figure>, <details> and <frameset> tag.