2

In my CodeIgniter application I am using following posted code for setting height of each <option> inside <select> but this code is not working, i.e. the height of <option> is not set to 50px. Please tell what can be the problem?

Code:

$("option").css("height", "50px");
Agha
  • 401
  • 2
  • 6
  • 13
  • 3
    You cannot reliably change the styling of `option` elements as they are tightly controlled by most browsers. If you want to change the UI of select/option elements you'll need to use a custom library which transforms them to HTML. – Rory McCrossan Apr 11 '18 at 13:34
  • I think the closest you can get to what you want to do is with bootstrap: https://silviomoreto.github.io/bootstrap-select/examples/ – mrdeadsven Apr 11 '18 at 15:21

0 Answers0