The legend element : legend « Form « HTML / CSS






The legend element

  

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
  "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
  <meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
  <title>The legend element</title>
</head>

<body>

  <form method="post" action="/">
    
    <fieldset> 
      <legend accesskey="T">Choose additional toppings</legend> 
      <ul> 
        <li><label for="top1"><input type="checkbox" id="top1" name="top1" value="peppers" /> Peppers</label></li>
        <li><label for="top2"><input type="checkbox" id="top2" name="top2" value="xcheese" /> Extra cheese</label></li> 
        <li><label for="top3"><input type="checkbox" id="top3" name="top3" value="mushrooms" /> Mushrooms</label></li> 
        <li><label for="top4"><input type="checkbox" id="top4" name="top4" value="olives" /> Olives</label></li> 
      </ul> 
    </fieldset>

  </form>

</body>
</html>

   
  








Related examples in the same category

1.Style for form legend
2.Set style for legend
3.form legend style
4.Set font, color, background color and text-transform for legend tag
5.Organizing Elements With fieldset and legend Elements
6.legend top: -.4em;
7.legend position: relative;
8.legend font-size: 1.4em;
9.legend font-weight: bold;
10.Set form access key
11.legend border: 1px solid #888; border-right: 1px solid #666; border-bottom: 1px solid #666;
12.legend padding: .5em;
13.legend background-color: #CCC;
14.legend background: gold;
15.legend border: 1px solid rgb(75, 75, 75);
16.legend color: rgb(75, 75, 75);