Set required textarea field to have solid border and highlight color : textarea : Text HTML CSS TUTORIALS


HTML CSS TUTORIALS » Text » textarea »

 

Set required textarea field to have solid border 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">
textarea.required, input.required  {
 border: 1px solid red;
 background-color: #eee;
}


</style>
</head>

<body>
   <form id="msgform" name="msgform" method="post" action="/process.php">
s   <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 Text
» textarea