• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Tim Cooke
  • Liutauras Vilda
  • Jeanne Boyarsky
  • paul wheaton
Sheriffs:
  • Ron McLeod
  • Devaka Cooray
  • Henry Wong
Saloon Keepers:
  • Tim Holloway
  • Stephan van Hulst
  • Carey Brown
  • Tim Moores
  • Mikalai Zaikin
Bartenders:
  • Frits Walraven

Firefox doesn't show background color for selected option

 
Greenhorn
Posts: 9
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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?


 
author
Posts: 15385
6
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Now, it is working fine in Firefox.
Thanks, Eric for your assistance on this issue.
 
catch it before it slithers away! Oh wait, it's a tiny ad:
Gift giving made easy with the permaculture playing cards
https://coderanch.com/t/777758/Gift-giving-easy-permaculture-playing
reply
    Bookmark Topic Watch Topic
  • New Topic