Grouping form elements using <fieldset> tag

Sometimes it is convenient to group various elements of a form. HTML provides <fieldset></fieldset> tags for that purpose.

Example Usage:

<fieldset>
 <legend>Contact Details</legend>
 <table>
 <tr>
 <td>Email:</td>
 <td><input type="text" /></td>
 </tr>
 
 <tr>
 <td>Mobile:</td>
 <td><input type="text" /></td>
 </tr>
 
 <tr>
 <td>Telephone:</td>
 <td><input type="text" /></td>
 </tr>
 </table>
</fieldset>

Just copy and paste the above code in body tag where you want to use it.

Add a Comment

Your email address will not be published. Required fields are marked *