开发者

html - controlling how many options show in a select element

So I have a drop down (select) element. The problem is that if there is a long list in it, then it "drops" upwards instead of downwards.

Is there a way to say that it should scroll rather than show all of them at once?

I know there's "size" but that's how many are visible at once (I only开发者_开发百科 want one visible, like normal)

Or is the reason it's not having a scrollbar automatically caused by it's containing div? Does it need to know where it should end or something?


The way this works is up to the browser. Nothing you can do about it, other than building your own drop-down with JS.


The problem is not the list size, it drops upwards or downwards according the size above or below to always show the entire list if possible. It's a comprehensive behaviour and I don't think (and I don't want) you can change it.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜