Is it possible to change the default background color of a select list option on hover?
HTML:
<select id="select">
<option value="1">One</option>
<option value="2">Two</option>
<option value="3">Three</option>
</select>
I have tried option:hover { background-color: red; }
, but it is of no use. Does anybody know how to do this?
The problem is that even JavaScript does not see the
option
element being hovered. This is just to put emphasis on how it's not going to be solved (any time soon at least) by using just CSS:The only way to resolve this issue (besides waiting a millennia for browser vendors to fix bugs, let alone one that afflicts what you're trying to do) is to replace the drop-down menu with your own HTML/XML using JavaScript. This would likely involve the use of replacing the
select
element with aul
element and the use of aradio
input
element perli
element.