Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Multiple select options are not taking the full width of the box on Internet Explorer 9

I have a multiple select input with a min-width set on the select element. The options are not taking up the full width of the available select box in Internet Explorer 9.

The items take up the full width on Chrome and Firefox. How do I make the option elements take the full width of the select input?

Notice the Saab item here in Internet Explorer:

Example

This Fiddle demonstrates the issue

<select style="min-width: 150px; width: auto;" name="cars" multiple>
  <option value="volvo" style="width: 100%;">Volvo</option>
  <option value="saab">Saab</option>
  <option value="opel">Opel</option>
  <option value="audi">Audi</option>
</select>

It works correctly in Chrome:

enter image description here

like image 497
Jace Rhea Avatar asked Jun 03 '13 18:06

Jace Rhea


1 Answers

To my knowledge, you can't give OPTION a block layout in IE. It will expand only to the width of its content, I don't believe you can fiddle with its width. You can, as you've demonstrated, adjust the width of the SELECT element without issue.

like image 178
Mister Epic Avatar answered Sep 28 '22 00:09

Mister Epic