Menu
The legend tag, or Field Set Legend, is used to define a caption for its parent <fieldset> element.
Example:
<form action="example-action.php">
<fieldset>
<legend>Your Name:</legend>
<label for="firstname">First name: </label>
<input type="text" id="firstname" name="firstname">
<label for="lastname">Last name: </label>
<input type="text" id="lastname" name="lastname">
</fieldset>
</form>User-submitted codepen.io examples of <legend> ↴
Submit a codepen.io link that demonstrates <legend>: