I am trying to change the background color for HTML select option tag when hover over it. But unfortunately, cant do that on Chrome Browser. Though it works on Microsoft Edge
Chrome Version: Version 83.0.4103.97 (Official Build) (64-bit)
HTML Code Snippet
<select class="gender-dropdown">
<option value="0" selected>Select Gender</option>
<option value="1">Male</option>
<option value="2">Female</option>
<option value="3">Transgender</option>
<option value="4">Other</option>
</select>
CSS Code Snippet
select:focus option:hover {
background-color: yellow;
}
Weirdly, when i use <select class="gender-dropdown" onfocus="this.size=5">
this works with same CSS, but i want to use it without onfocus function. I have found similar problems with solutions but none of them worked for me. May be because most of them are quite old.
Am I missing something here? Any Help/Guidance is appreciable.
Thanks in advance.
Working Code Snippet https://www.codeply.com/p/HShzArOdic