DropDownList width problem with FireFox/Safari

本文讨论了在不同浏览器(IE与Firefox)中下拉列表(DDL)显示宽度不一致的问题,尤其是在文本长度变化时的滚动条可见性问题。作者尝试了多种解决方案,包括使用CSS样式、BrowserCaps编码以及限制DDL文本长度等方法。

I am populating a DDL with a Title (text: length 255) from my Access DB.

If I don’t define a width ,in IE. The DDL assumes a width of my webpage, which is fine because the scroll bar on the left is still viewable and I am able to scroll down to choose an item.

In Firefox, the DDL assumes the length of the longest text item, thereby not allowing the scrollbar to be viewable and it is not possible to scroll.

If I do define a width (100%), either in the control itself or using Style, IE again uses the width of the webpage for the DDL still allowing the scrollbar to be used.

Firefox, once again assumes the length of the longest text item, and there is no possibility to scroll.

I have been searching around for possible solutions to this problem but can’t find any.

For instance, I have tried to define a CSS Class with width:100% which works fine in IE but not in Firefox.

I also tried to add some BrowserCaps coding to my WebConfig, but it did not affect anything.

So what I have done is to use a Query and just present the first 100 or so characters of the title to the DDL.

If someone has an ASP.NET solution, I would like to hear about it.

The scroll bar is invisible as below:

Dropdownlist_Width_in_Firefox

 

http://forums.asp.net/t/1090990.aspx

http://www.webdeveloper.com/forum/showthread.php?t=97470

http://v2.easy-designs.net/articles/replaceSelect/

http://v2.easy-designs.net/articles/replaceSelect2/

转载于:https://www.cnblogs.com/emanlee/archive/2010/10/22/1858687.html

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值