简体   繁体   English

如何设置选择标签选项的下拉列表的高度和宽度

[英]How to set the height and width of select tag option's drop down list

I have a select tag use on my jsp page.我在我的 jsp 页面上使用了一个 select 标签。 When the options are added for select then the dropdown list of option covers half of my page as well as width is also as per data and thus goes out of the page thus hides half of my data.当为选择添加选项时,选项的下拉列表覆盖我页面的一半,宽度也与数据相同,因此超出页面从而隐藏了我的一半数据。

How can I set the height so when I click on the down arrow of the select it shows me first 5 options with a scroll for the others?如何设置高度,以便当我单击选择的向下箭头时,它会显示前 5 个选项并为其他选项滚动? And how to code so that its width can be adjusted?以及如何编码以调整其宽度?

他是对的,您可以使用自定义下拉插件,例如http://designwithpc.com/Plugins/ddSlick或尝试向您添加 size="5" 但这会删除下拉功能并使其更像是一个列表。

use

overflow-y:auto;

hope it helped希望它有帮助

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM