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>
Have a code example of <legend>
? Submit a codepen.io demo and we'll showcase it here ↴