Set required label field to have bold font and highlight color : input : Form Style HTML CSS TUTORIALS


HTML CSS TUTORIALS » Form Style » input »

 

Set required label field to have bold font and highlight color


 

<!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">
<head>
<title></title>
<style type="text/css">
label.required {
 color: #c00;
 font-weight: bold;
}

</style>
</head>

<body>
   <form id="msgform" name="msgform" method="post" action="/process.php">
   <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" class="required">
  <span class="akey">E</span>mail <img src="alert.gif" /> Required</label>
    <input type="text"  name="fmemail" id="fmemail" class="required" />
   </fieldset>
   <fieldset>
    <legend>Your Message</legend>
    <label for="fmstate" accesskey="y">Subject</label>
    <input type="text" name="fmcountry" id="fmcountry" />
    <label for="fmmsg" class="required"><span class="akey">M</span>essage 
  <img src="alert.gif" /> Required</label>
    <textarea name="fmmsg" accesskey="m" id="fmmsg" rows="5" cols="14" class="required"></textarea>
   </fieldset>
   <input type="submit" name="submit" value="send" class="submit" />
  </form>
</body>

</html>

 



HTML code for linking to this page:

Follow Navioo On Twitter

HTML CSS TUTORIALS

 Navioo Form Style
» input