html legend fieldset
snippet in html

fieldset in html

Pravin Bawle

<form action="/action_page.php">
  <fieldset>
    <legend>Personalia:</legend>
    <label for="fname">First name:</label>
    <input type="text" id="fname" name="fname"><br><br>
    <label for="lname">Last name:</label>
    <input type="text" id="lname" name="lname"><br><br>
    <label for="email">Email:</label>
    <input type="email" id="email" name="email"><br><br>
    <label for="birthday">Birthday:</label>
    <input type="date" id="birthday" name="birthday"><br><br>
    <input type="submit" value="Submit">
  </fieldset>
</form>

what is a fieldset html

user4126

The <fieldset> is a tool for organizing and grouping related 
items within a form. (Mostly visual for the reader).
 
 <form>
  <fieldset>

    <input type="radio" id="kraken" name="monster">
    <label for="kraken">Kraken</label>

    <input type="radio" id="sasquatch" name="monster">
    <label for="sasquatch">Sasquatch</label>

  </fieldset>
</form>

html legend fieldset

user8771


    <form action="/action_page.php">
  <fieldset>
    
    <legend>Personalia:</legend>
    <label for="fname">First 
    name:</label>
    <input type="text" id="fname" name="fname"><br><br>
    
    <label for="lname">Last name:</label>
    <input 
    type="text" id="lname" name="lname"><br><br>
    <label 
    for="email">Email:</label>
    <input type="email" 
    id="email" name="email"><br><br>
    <label 
    for="birthday">Birthday:</label>
    <input type="date" 
    id="birthday" name="birthday"><br><br>
    <input 
    type="submit" value="Submit">
  </fieldset>
</form>