I'm using a dropdown
but the problem is with CSS
. On hover
of all the options, the default color of option is blue. Can I change this color through CSS
or by any means?
Asked
Active
Viewed 1,405 times
0

TryinHard
- 4,078
- 3
- 28
- 54

Aditya Kumar
- 165
- 1
- 1
- 16
-
1without using any extra plugins – Aditya Kumar Jul 28 '15 at 05:25
-
1You understand that on different devices that list looks differently, don't you? And even some of those devices do not have :hover as a concept. – c-smile Jul 28 '15 at 05:33
-
select option:hover { padding-left: 25px; width: 270px; color: green !important; } – Aditya Kumar Jul 28 '15 at 05:36
-
This is most of the time, an OS specific behavior. Also different browsers behave differently in this case. Sometimes, CSS won't affect because it will get overridden by the OS itself. Look [here](http://stackoverflow.com/questions/1667086/changing-select-highlight-color) also – Aruna Tebel Jul 28 '15 at 05:40
-
do you want to change the background colour ? – Felix A J Jul 28 '15 at 05:44
-
This can't be done with HTML and css only but it looks like you [can do it with javascript/jquery][1] [1]: http://stackoverflow.com/questions/4599975/html-select-box-options-on-hover – Jul 28 '15 at 05:47
1 Answers
0
Unfortunately OS and browsers override <select>
and <option>
controls, each in a different way, and it's an OS-centric control (unlike <input>
boxes, which are mainly customizable and can be fully changed by your website). You won't be able to change it (not consistently anyway), but a good solution would be to implement something as Bootstrap's dropdowns or a jQuery plugin such as Chosen which give you dropdowns that are completely customizable and way more flexible anyway.

casraf
- 21,085
- 9
- 56
- 91