开发者

asp:dropdownlist width: How to make the control narrower than the dropdown list

开发者 https://www.devze.com 2023-01-08 04:11 出处:网络
I have a web form with a dropdown list <asp:dropdownlist>, but for the sake of formatting I want the actual contro开发者_JAVA百科l (before you open the dropdown list) to be relatively narrow.Whe

I have a web form with a dropdown list <asp:dropdownlist>, but for the sake of formatting I want the actual contro开发者_JAVA百科l (before you open the dropdown list) to be relatively narrow. When the user opens the contents of the dropdown, I want the actual list to appear wider than the control.

Something like this:

asp:dropdownlist width: How to make the control narrower than the dropdown list

How can you achieve this functionality with ASP.NET webforms?


Basically, either the browser will expand the list width when dropped or it won't. And you guessed it IE won't.

Your only bet with IE is to set the title attribute of the option element to the value text. Then you will get a tooltip.


Surely this is just a css issue? On the dropdownlist control you could either say width="50" or put the style tag on there style="width: 50px".
I think you may possibly always run into issues with IE 6/7 though no matter which way you do it

0

精彩评论

暂无评论...
验证码 换一张
取 消