<legend>

Description

This element inserts a descriptive caption in the container box of a <fieldset> element. You use this element to define the group of fields contained in the <fieldset> element.

Example


<html>
<body>
     <form name="form1" method="post" action="">
          <p>
          <fieldset align="center">
               <legend>Credit Card Information:</legend>
               <input type="text" 
                      name="textfield" 
                      value="Name" 
                      size="60"/><br/>
               <input type="text" 
                      name="textfield2" 
                      value="Exp. date" 
                      size="50"/><br/>
               <input type="text" 
                      name="textfield3" 
                      value="Type" 
                      size="65"/><br/>
               <input type="text" 
                      name="textfield4" 
                      value="Number" 
                      size="45"/>
          </fieldset>
          </p>
     </form>
</body><!--from w w w  .j a v  a  2s .  co m-->
</html>

Click to view the demo

The code above generates the following result.

legend




















Home »
  HTML CSS »
    HTML CSS Reference »




HTML Tag Reference
CSS Reference
CSS Selector Reference
Encoding Reference