Set style for legend : legend « Form « HTML / CSS






Set style for legend

  

<!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">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1" />
<title></title>
<style type="text/css">
legend {
  font-weight: bold;
  border: 1px solid #888;
  border-right: 1px solid #666;
  border-bottom: 1px solid #666;
  padding: .5em;
  background-color: #CCC;
}

</style>
</head>
<body>
<div id="container">
  <div id="wrapper">
    <div id="content">
      <form id="form1" name="form1" method="post" action="/">
        <fieldset>
        <legend>Contact Information</legend>
        <label for="fmtitle" accesskey="i">T<span class="akey">i</span>tle</label>
        <select name="fmtitle" id="fmtitle">
          <option value="ms">Ms.</option>
          <option value="mrs">Mrs.</option>
          <option value="miss">Miss</option>
          <option value="mr">Mr.</option>
        </select>
        <label for="fmname" accesskey="n"><span class="akey">N</span>ame</label>
        <input type="text" name="fmname" id="fmname" />
        <label for="fmemail" accesskey="e"><span class="akey">E</span>mail</label>
        <input type="text"  name="fmemail" id="fmemail" />
        </fieldset>
        <fieldset>
        <legend>Your Message</legend>
        <label for="fmstate" accesskey="y">Subject</label>
        <input type="text" name="fmcountry" id="fmcountry" />
        <label for="fmmsg"><span class="akey">M</span>essage</label>
        <textarea name="fmmsg" accesskey="m" id="fmmsg" rows="5" cols="14"></textarea>
        </fieldset>
        <input type="submit" name="submit" value="send" class="submit" />
      </form>
    </div>
  </div>
</div>
</body>
</html>

   
  








Related examples in the same category

1.The legend element
2.Style for form 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);