Win a copy of Programmer's Guide to Java SE 8 Oracle Certified Associate (OCA) this week in the OCAJP forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Firefox doesn't show background color for selected option

 
kartik reddy
Greenhorn
Posts: 9
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I want to show color for selected option in Firefox.
Surprisingly, IE get this right. But in Firefox is failing to display color in selected option.

Here is the code:

<html>
<body>
<Select>
<option value="1" select="selected" style="color:red"> RED </option>
<option value="2" style="color:green">GREEN</option>
<option value="3" style="color:black" >Black</option>
</select>
</body>
</html>

Could anyone suggest how to proceed further?


 
Eric Pascarello
author
Rancher
Posts: 15385
6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
well your example show color and not background color.

To set the color of the select, you need to use some JavaScript.

http://jsbin.com/ifitic/2/

Eric
 
kartik reddy
Greenhorn
Posts: 9
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Now, it is working fine in Firefox.
Thanks, Eric for your assistance on this issue.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic