在HTML下拉列表中只显示一些选项 [英] Show just some options in in HTML drop down list

查看:127
本文介绍了在HTML下拉列表中只显示一些选项的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如何在下拉列表中显示10个选项,其余的可以使用滚动条显示?

How can I show 10 option out of 100 in the drop down list and the rest to be available using scrollbar?

非常感谢。

推荐答案

你可以尝试这个小技巧...

You could try this little trick...

<select max="2" onmouseover="this.size = 10" onmouseout="this.size = 1">

它有效地使您的选择下载到鼠标悬停的列表中,并将其重新放回鼠标。

it effectively makes your select drop down into a list on mouse over and puts it back on mouse out.

这是欺骗,可能会弄乱你的HTML定位,但它的工作。

it's cheating and can mess up your html positioning, but it works.

编辑:我很漂亮确保您无法更改单击选择时显示的菜单的大小,这由浏览器决定,而不是由页面控制。

I'm pretty sure you can't change the size of the menu displayed when you click a select, this is determined by the browser and not controllable by the page.

这篇关于在HTML下拉列表中只显示一些选项的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆