如何在IE的选择框中获得水平滚动条? [英] How to get horizontal scroll bar in select box in IE?

查看:26
本文介绍了如何在IE的选择框中获得水平滚动条?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我尝试实现以下代码

<select name="sets" style="overflow:auto;width:100px;"><option value="general">节日快乐</option><option value="garden">Garden</option><option value="午餐">午餐</option><option value="nice day">和我的朋友在海滩上度过美好的一天</option></选择>

第四个选项菜单的右边部分不见了,谁能告诉我在IE中让水平滚动起作用,如果没有,有没有其他方法可以让它起作用,谢谢!

很抱歉有任何混淆,我想要的是下拉框中的水平滚动条,我想要它固定宽度 100px;但我想显示整个内容,如果用户想在下拉选择框中查看整个句子,我假设用户可以向右滚动,

解决方案

我不太确定你想要达到什么目的.这只是一个 select 列表.只需删除您的样式,它就会根据您的内容自动调整大小.

编辑

使包含列表的容器滚动.注意:它的可用性有些问题,所以我会在页面上实现类似的东西之前寻找另一种解决方案.

<选择名称=集合"><option value="general">节日快乐</option><option value="garden">Garden</option><option value="午餐">午餐</option><option value="nice day">和我的朋友在海滩上度过美好的一天</option></选择>

#selector_cat{宽度:100px;溢出:自动;}

I try to implement the following code

<div class="functionitem" id="selector_cat">
  <select name="sets" style="overflow:auto;width:100px;">
    <option value="general">happy holiday</option>
    <option value="garden">Garden</option>
    <option value="Lunch">Lunch</option>
    <option value="nice day">A nice day out with my friend on the beach</option>
  </select>
</div>

The right part of the 4th option menu is missing, Can anyone tell me make the horizontal scroll work in the IE, if not, is there any other ways that could get it work, thank you!

sorry for any confusion, what i want is that a horizontal scroll bar in the drop down box, I want it fixed width 100px; but I want to display the whole content, I assume user can scroll to the right if they want to see the whole sentence in the drop down select box,

解决方案

I’m not really sure what you’re trying to achieve. This is simply a select list. Just remove your styling and it will automatically size to your contents.

EDIT

Make the container that contains the list scroll. Note: the usability of this is somewhat questionable so I would look for another solution prior to implementing something like this on a page.

<div id="selector_cat"> 
    <select name="sets">
        <option value="general">happy holiday</option>
        <option value="garden">Garden</option>
        <option value="Lunch">Lunch</option>
        <option value="nice day">A nice day out with my friend on the beach</option>
    </select>
</div>

#selector_cat{
    width: 100px; 
    overflow: auto;
}

这篇关于如何在IE的选择框中获得水平滚动条?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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