HTML - tags - <legend>

#75 of 147
legend
Next li
Prev label

 <html>
 <body>
     <form action="SubscribeForm.aspx" method="post">
         <fieldset>
             <legend>Name:</legend>
             <label for="id_first">First</label>
             <input type="text" id="id_first" name="form_first">/input>
             <label for="id_last">Last</label>
             <input type="text" id="id_last" name="form_last">/input>
         </fieldset>
         <fieldset>
             <legend>Contact info:</legend>
             <label for="id_email">Email</label>
             <input type="email" id="id_email" name="form_email">/input>
         </fieldset>
         <button type="submit">Subscribe</button>
     </form>
 </body>
 </html>
 

The legend element creates a title for a group of fields on a form.

A live example:


Name:
Contact info:

N of

Ads by Google

Ask a question, send a comment, or report a problem - click here to contact me.

© Richard McGrath