This week's giveaway is in the EJB and other Java EE Technologies forum.
We're giving away four copies of EJB 3 in Action and have Debu Panda, Reza Rahman, Ryan Cuprak, and Michael Remijan on-line!
See this thread for details.
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


Win a copy of EJB 3 in Action this week in the EJB and other Java EE Technologies forum!
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
 
Similar Threads
how to see select box options for moretha 40 pxcels
Bilingual JSP application
Javascript search issue
customize an option element in dropdown
show the whole content in combo box