Reputation: 12748
I have limited space and element in a dropdown with a large amount of text.
It it possible to have the dropdown width small but the popup of the list large?
Edit: I'm using IE
Upvotes: 2
Views: 3529
Reputation: 30388
Yes, it is possible. And in current browsers, you don’t have to do anything special for the different sizes to work. Just set the width
of your select
, and the option
s will still be as big as they need to be.
<select id="menu">
<option>short</option>
<option>a quite long option that is wider than the select</option>
<option>another option</option>
</select>
#menu {
width: 100px;
}
This works in Firefox, Chrome, and IE10:
But IE9 doesn’t support this:
Upvotes: 3
Reputation:
I'm afraid IE is the cuplrit here. Other browsers give you whatever width you need for your option
s and leave the select box at the size you define but IE8 and lower cuts it off to the width of the parent select
box.
The answer lies with jQuery and is wonderfully documented here: Dropdownlist width in IE
Upvotes: 1
Reputation: 46
I don't know if it can help you, but i found something on css-tricks :
http://css-tricks.com/select-cuts-off-options-in-ie-fix/
Take a look, hope it could help you!
Upvotes: 1