Does someone know how to stylize option element inside Select control I tried with css like select option{}
or i tried to put id, class and even I tried to put select into but that doesn't work I want to change width, height, padding
Asked
Active
Viewed 41 times
0

jhony3
- 272
- 1
- 2
- 13
-
The CSS you can place on `option` elements is very restricted. If you want to style them you would be best to use a third party library, such as Select2 or Chosen – Rory McCrossan Sep 09 '16 at 14:22
-
But I don't use that library must be a way – jhony3 Sep 09 '16 at 14:23
-
No I'm afraid not. – Rory McCrossan Sep 09 '16 at 14:23
-
It must be done with Jquery I tried one solution here but It doesn't work for me ? – jhony3 Sep 09 '16 at 14:24
-
It is a possible duplicate of this thread, you might find a solution here, http://stackoverflow.com/questions/7208786/how-to-style-the-option-of-a-html-select – achref Sep 09 '16 at 14:26
-
you will need JS to have the most consistent result ... hide the select and recreate that with another html elements. – DaniP Sep 09 '16 at 14:27
-
thx @achref I tried this but id doesn't work for me – jhony3 Sep 09 '16 at 14:28
-
Yep which is what the libraries I mentioned in my first comment do. You can of course roll your own versions, but why re-invent the wheel for very little gain – Rory McCrossan Sep 09 '16 at 14:28
-
That is exactly what they explained @jhony3 , select element is OS dependent so you probably need to find a workaround – achref Sep 09 '16 at 14:30
-
That is the easy way It must be done with js – jhony3 Sep 09 '16 at 14:56