0 Replies - 1246 Views - Last Post: 26 February 2009 - 10:15 PM

#1 no2pencil  Icon User is offline

  • Professor Snuggly Pants
  • member icon

Reputation: 6551
  • View blog
  • Posts: 30,682
  • Joined: 10-May 07

Change the text color in option tag

Posted 26 February 2009 - 10:15 PM

Description: Using css, you can point the individual options to the class type/name for the effect you want them to have.
<!--
  Written by #2pencil 02.27.09
  for Dream In Code
  - http://akroncdnr.com -
-->
<html>
<head><title>Change the text color in your option tag</title>
 <style>
  .red {
	  color: red;
	  font-size: 2em;
  }
  .blue {
	  color: blue;
	  font-weight: bold;
  }
 </style>
</head>
<body>
 <select multiple size='5'>
  <option>Option #1</option>
  <option class="red">Option #2</option>
  <option>Option #3</option>
  <option class="blue">Option #4</option>
 </select>
 <p><small>
 Written by #2pencil 02.27.09
 
for Dream In Code
 </small></p>
</body></html> 


Is This A Good Question/Topic? 0
  • +

Page 1 of 1