Problem:
My dropdown is loaded dynamically has some options that are quite long and this is messing up my page layout. I'd like the size of the select
element to be small but when expanded, allow the user to see all the long options
. To do this I have set the width
of the SELECT
to a fixed value e.g width:200px;
Expected/Desired Behavior (Works in Chrome)
Actual Behavior in IE8
What I have tried:
select{
overflow:show;
}
option{
overflow:show;
width:1000px;
}
SIMPLIFIED FIDDLE:
http://jsfiddle.net/gCbhq/2/
The select tag is in default method and the long text does not appear fully in html. Also, sometimes due to webpage patterns, we want to increase width of tags. So, we give CSS to select and option tags, in this we set the width in pixel in select and minimum width in option.
The size attribute specifies the number of visible options in a drop-down list. If the value of the size attribute is greater than 1, but lower than the total number of options in the list, the browser will add a scroll bar to indicate that there are more options to view.
Ok. Not sure if this helps. I'm using Jquery Mobile and my select button is icon-only (= 28px). On IE8 all my options hence where 28px, too.
I fixed it with this:
select { min-width: 150px !important; }
but this only works, because Jquery Mobile hides the select and adds it's own elements "on top".
Alas, here is a fix - http://css-tricks.com/select-cuts-off-options-in-ie-fix/
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With