Height of an HTML select box (dropdown)

前端 未结 7 689
天涯浪人
天涯浪人 2020-11-22 08:48

Can someone confirm that its not possible to change the height of a dropdown that is shown when you click on a select box.

The size attribute of th

7条回答
  •  挽巷
    挽巷 (楼主)
    2020-11-22 09:12

    Confirmed.

    The part that drops down is set to either:

    1. The height needed to show all entries, or
    2. The height needed to show x entries (with scrollbars to see remaining), where x is
      • 20 in Firefox & Chrome
      • 30 in IE 6, 7, 8
      • 16 for Opera 10
      • 14 for Opera 11
      • 22 for Safari 4
      • 18 for Safari 5
      • 11 in IE 5.0, 5.5
    3. In IE/Edge, if there are no options, a stupidly high list of 11 blanks entries.

    For (3) above you can see the results in this JSFiddle

提交回复
热议问题