Chrome- display:none options in select

后端 未结 2 1830
灰色年华
灰色年华 2021-01-19 18:06

How come my drop down in google chrome is only ONE line scrollable? Instead of multiple line scrollable? Here\'s my html code:


                        
    
提交评论

  • 2021-01-19 18:32

    The browser is causing the height of the drop down to render as the height of the first lot of visible items up to a specific size. You'll notice however that if you put two at the top, you get two lines, three visible gives three lines and so on. The other options are still there since you can reach them with the scrollbar, however the scrollbar is not stepping by the correct amount.

    Hiding options in this manner breaks in more browsers than it works in. My recommendation would be to instead remove the options you don't need from the select itself rather than using display:none.

    0 讨论(0)
  • 提交回复
    热议问题