简体   繁体   English

HTML下拉列表问题

[英]Problem with html drop down list

I am having problem with my html drop down select box. 我的html下拉选择框有问题。 I have long list of items in select box therefore it goes outside of my screen. 我在选择框中有很长的项目列表,因此它超出了我的屏幕。 it doesn't shows scroll bar. 它不显示滚动条。 Please help 请帮忙 替代文字

尝试强制size

<select ... size="1">

Could you post the HTML and any css that styles the select? 您可以发布HTML以及选择样式的CSS吗? Inspect the select element in Firebug and see what the overflow attribute is set that (it should default to auto and create the scrollbar if necessary). 检查Firebug中的select元素,并查看设置了哪些overflow属性(默认情况下应设置为auto并在必要时创建滚动条)。

<select id="#long-select> 
    <option ...>...</option>
    <option ...>...</option>
    ...
</select>

Then the correspond CSS: 然后是对应的CSS:

#long-select { overflow: auto; }

Try opening your page in IE, should show all elements. 尝试在IE中打开页面,应显示所有元素。

I think it is a bug in Firefox, that the list element is always aligned to the select field. 我认为Firefox的一个错误是,列表元素始终与选择字段对齐。 IE does not show the list outside of the screen. IE不在屏幕外显示列表。

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

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