Hello,
Does anyone here know how I can change the highlight color of a selected item in a drop down menu using CSS?
| SitePoint Sponsor |
Hello,
Does anyone here know how I can change the highlight color of a selected item in a drop down menu using CSS?





VirtueTech...
This is what you are looking for:
<style type="text/css">
<!--
option { color: #cc0000; background-color: #000000; }
.another { color: #00000; background-color: #33ff00; }
-->
</style>
The first example (OPTION) will apply to every instance of the OPTION tag, no further coding is needed.
If you wanted to apply a style to only one OPTION tag, then you would use the second example (.another) and do this:
<select>
<option>this is a test</option>
<option class="another">Another test</option>
<option>One last test</option>
<option>One last test</option>
<option>One last test</option>
<option>One last test</option>
</select>
Is that clear?
Last edited by creole; Apr 12, 2001 at 11:38.
Adobe Certified Coldfusion MX 7 Developer
Adobe Certified Advanced Coldfusion MX Developer
My Blog (new) | My Family | My Freelance | My Recipes
Yes but it does not change the color of the SELECTED option or the option the user has highlighted.
How do I change that?





ah...I don't believe you can change that as that is a Windows API thing (I think).
I am pretty sure that you will have no luck there...
Adobe Certified Coldfusion MX 7 Developer
Adobe Certified Advanced Coldfusion MX Developer
My Blog (new) | My Family | My Freelance | My Recipes





lol..juz to add some..
hey..( pardon me..trying to raise my post count...juz joking..ahah )
you could add other properties..like font family, size and more.
"Imagination is more important than knowledge. Knowledge is limited. Imagination encircles the world."
-- Albert Einstein
Bookmarks