aspose file tools*
The moose likes HTML, CSS and JavaScript and the fly likes Firefox doesn't show background color for selected option Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Engineering » HTML, CSS and JavaScript
Bookmark "Firefox doesn Watch "Firefox doesn New topic
Author

Firefox doesn't show background color for selected option

kartik reddy
Greenhorn

Joined: Dec 11, 2008
Posts: 9
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

Joined: Nov 08, 2001
Posts: 15376
    
    6
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

Joined: Dec 11, 2008
Posts: 9
Now, it is working fine in Firefox.
Thanks, Eric for your assistance on this issue.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Firefox doesn't show background color for selected option