How can you CSS style a <select> tag?
-
Saturday, March 10, 2012 5:01 PM
How can you use CSS to set the color of the highlighted item in a <select> dropdown?
I mean while the dropdown is active, as you hover the mouse over items in the list, the items are highlighted in a teal color.
Changing other css attributes of the <select> works fine, but not the hover/highlight color for an item.
Thank you-
All Replies
-
Sunday, March 11, 2012 10:25 AM
Hi,
you would not do that on the <select> tag. You better use the hover property of the option-tag. Try something like the following:
... <style type="text/css"> option:hover { background: #C6C4BD; } </style> ... <select> <option>Item 1</option> <option>Item 2</option> <option>Item 3</option> </select> ...Best Regards. When you see answers and helpful posts, please click Vote As Helpful, Propose As Answer, and/or Mark As Answer. This helps us build a healthy and positive community.
- Proposed As Answer by Jeff SandersMicrosoft Employee, Moderator Monday, March 12, 2012 1:35 PM
- Unproposed As Answer by S - Lee Whitney Tuesday, March 13, 2012 6:34 PM
- Marked As Answer by S - Lee Whitney Tuesday, March 13, 2012 6:35 PM
-
Tuesday, March 13, 2012 6:34 PM
Thanks that will work -
- Edited by S - Lee Whitney Tuesday, March 13, 2012 6:35 PM mistake


