<fieldset> HTML Tag

In this article I will discuss <fieldset> tag of HTML
  • 2439

The HTML fieldset tag is used for grouping related form elements. By using the fieldset tag and the legend tag, you can make your forms much easier to understand for your users.

Example

<html>

<head>

    <title></title>

    <style type="text/css">

        .style1

        {

            width: 195px;

        }

    </style>

</head>

<body>

    <fieldset>

        <legend>

            <h3>

                Personal Information</h3>

        </legend>

        <table style="width: 442px">

            <tr>

                <td class="style1">

                    Name:

                </td>

                <td>

                    <input type="text" style="height: 21px; width: 197px" /><br />

                </td>

            </tr>       

        <tr>

            <td class="style1">

                Email:

            </td>

            <td>

                <input type="text" style="height: 22px; width: 197px" /><br />

            </td>

        </tr>

        <tr>

            <td class="style1">

                Date of birth:

            </td>

            <td>

                <input type="text" style="height: 25px; width: 194px" /><br />

            </td>

        </tr>

        </table>

    </fieldset>

    <br /><br />

    <fieldset>

        <legend>

            <h3>

                Contact Information</h3>

        </legend>

        <table style="width: 442px">

            <tr>

                <td class="style1">

                    Contact_Number:

                </td>

                <td>

                    <input type="text" style="height: 21px; width: 197px" /><br />

                </td>

            </tr>       

        <tr>

            <td class="style1">

                Fax_Number:

            </td>

            <td>

                <input type="text" style="height: 22px; width: 197px" /><br />

            </td>

        </tr>

        <tr>

            <td class="style1">

               Mobile_Number:

            </td>

            <td>

                <input type="text" style="height: 25px; width: 194px" /><br />

            </td>

        </tr>

        </table>

    </fieldset>

</body>

</html>

 

Output


fieldset.jpg
 

Ask Your Question 
 
Got a programming related question? You may want to post your question here
 

 

 

© 2020 DotNetHeaven. All rights reserved.