Organizing Elements With fieldset and legend Elements : legend : Form Style HTML CSS TUTORIALS


HTML CSS TUTORIALS » Form Style » legend »

 

Organizing Elements With fieldset and legend Elements


 
<?xml version="1.0" ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
    "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" lang="en" xml:lang="en">

<head>
  <title>Organizing Elements With &lt;fieldset&gt; and &lt;legend&gt;Elements</title>
</head>

<body>
<form action="" method="post" name="frmComp">
  <fieldset>
    <legend><em>Contact Information</em></legend>
      <label>First name: <input type="text" name="txtFName" size="20" /></label><br />
      <label>Last name: <input type="text" name="txtLName" size="20" /></label><br />
      <label>E-mail: <input type="text" name="txtEmail" size="20" /></label><br />
  </fieldset>
  <fieldset>
      <legend><em>Competition Question</em></legend>
  </fieldset>
  <fieldset>
    <legend><em>Question</em></legend>
      <label>say why you would like to win $10,000: <br />
        <textarea name="txtTiebreaker" rows="10" cols="40"></textarea>
      </label>
  </fieldset>
  <fieldset>
    <legend><em>Enter competition</em></legend>
       <input type="submit" value="Enter Competition" />
  </fieldset>
</form>
</body>
</html>

 



HTML code for linking to this page:

Follow Navioo On Twitter

HTML CSS TUTORIALS

 Navioo Form Style
» legend