The Shed is going Social! Join us on FaceBook and Twitter and chime in on the conversation.
|
 |
|
Dev Shed Forums
> Web Design
> CSS Help
|
CSS: Highlight color in <select>
Discuss CSS: Highlight color in <select> in the CSS Help forum on Dev Shed. CSS: Highlight color in <select> Cascading Style Sheets (CSS) forum discussing all levels of CSS, including CSS1, CSS2 and CSS Positioning. CSS provides a robust way of applying standardized design concepts to your web pages.
|
|
 |
|
|
|
|

Dev Shed Forums Sponsor:
|
|
|

August 6th, 2002, 12:05 PM
|
|
Junior Member
|
|
Join Date: Apr 2002
Posts: 10
Time spent in forums: 2 m 2 sec
Reputation Power: 0
|
|
|
CSS: Highlight color in <select>
How do I set the color of the highlighted (selected) option from a <select> field? For example, how would I change the color of the selected forum in the forum jump dropdown at the bottom of this page?
Thanks.
|

August 6th, 2002, 02:19 PM
|
|
Senior Citizen
|
|
Join Date: Jan 2001
Location: leftcoast
Posts: 2,019
Time spent in forums: < 1 sec
Reputation Power: 15
|
|
You wouldn't. 
|

August 6th, 2002, 02:46 PM
|
|
Junior Member
|
|
Join Date: Apr 2002
Posts: 10
Time spent in forums: 2 m 2 sec
Reputation Power: 0
|
|
Ahh, that would probably explain why I couldn't find out how.
Thanks for the reply.
|

August 7th, 2002, 05:26 AM
|
 |
Senior Member
|
|
Join Date: Jun 2000
Location: Enschede, The Netherlands
Posts: 1,527
Time spent in forums: 2 h 55 m 57 sec
Reputation Power: 14
|
|
You could
Code:
<style>
option.opt1 {
background: #F1F1F1;
}
option.opt2 {
background: #0088FF;
}
</style>
<select>
<option value="" class=opt1>Test</option>
<option value="" class=opt1>Test</option>
<option value="" class=opt2 selected>Test</option>
<option value="" class=opt1>Test</option>
<option value="" class=opt1>Test</option>
</select>
|

August 7th, 2002, 10:38 AM
|
|
Junior Member
|
|
Join Date: Apr 2002
Posts: 10
Time spent in forums: 2 m 2 sec
Reputation Power: 0
|
|
|
Mirax,
That isn't quite what I want to do. I want to set the color of the item the mouse is over. Currently it defaults to whatever "Selected Items" in the Display Properties is set to.
|

August 7th, 2002, 11:25 AM
|
 |
Senior Member
|
|
Join Date: Jun 2000
Location: Enschede, The Netherlands
Posts: 1,527
Time spent in forums: 2 h 55 m 57 sec
Reputation Power: 14
|
|
|
okay, something with option onMouseOver="highlight()" and a javascript function which changes the style of the option should do it then?
|

August 7th, 2002, 11:46 AM
|
|
CF sMod
|
|
Join Date: Jul 2000
Location: Maine, USA (a.k.a. Boonies)
Posts: 242
Time spent in forums: 6 m 43 sec
Reputation Power: 13
|
|
|
IE does not fire any events on <option/> elements.
In Gecko, with XBL form bindings enabled, this is possible. But they are disabled by default.
|

August 7th, 2002, 03:25 PM
|
 |
Senior Member
|
|
Join Date: Jun 2000
Location: Enschede, The Netherlands
Posts: 1,527
Time spent in forums: 2 h 55 m 57 sec
Reputation Power: 14
|
|
forget my JavaScript comment, it's nonsense
The only thing I can think of would be some css code, but I can't find it anywhere  One would expect it's possible to change the color like it is possible to change the scrollbar color (also system dependant) 
|

August 7th, 2002, 05:12 PM
|
|
Senior Citizen
|
|
Join Date: Jan 2001
Location: leftcoast
Posts: 2,019
Time spent in forums: < 1 sec
Reputation Power: 15
|
|
You wouldn't. 
|
Developer Shed Advertisers and Affiliates
| Thread Tools |
Search this Thread |
|
|
|
| Display Modes |
Rate This Thread |
Linear Mode
|
|
Posting Rules
|
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
HTML code is Off
|
|
|
|
|