Set font, color, background color and text-transform for legend tag : legend « Form « HTML / CSS






Set font, color, background color and text-transform for legend tag

  


<!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=utf-8" />
    <title></title>
    <style type="text/css" media="Screen">
legend {
    padding: 0 10px;
    font: 12px Verdana, Arial, sans-serif;
    color: #000000;
    background-color: #ccc;
    text-transform: uppercase;
}

    </style>
</head>
<body>
    <form action="" enctype="x-www-form-encoded" method="post">
        <fieldset>
            <legend>Personal information</legend>
            <p><strong><label for="realname">Name</label></strong><br />
            <input class="formField" type="text" id="realname" name="realname" size="30" /></p>
            <p><strong><label for="email">Email address</label></strong><br />
            <input class="formField" type="text" id="email" name="email" size="30" /></p>
            <p><strong><label for="phone">Telephone</label></strong><br />
            <input class="formField" type="text" id="phone" name="phone" size="30" /></p>
        </fieldset>
    </form>
</body>
</html>

   
  








Related examples in the same category

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