Is there a way to fix the width of drop down list?

Posted by Harry Pham on Stack Overflow See other posts from Stack Overflow or by Harry Pham
Published on 2010-03-08T21:43:24Z Indexed on 2010/03/09 0:06 UTC
Read the original article Hit count: 225

Filed under:
|
|

Here is what I got:

<select id="box1">
   <option>ABCDEFG</option>
</select>  

<select id="box2">
   <option>ABCDEFGHIJKLMNO</option>
</select>

I have 2 different Drop Down lists. Since the width of a drop down list depends on the width of the longest text in the option, I end up with 2 drop down lists with 2 different widths. This makes my webpage look goofy.

What I want is to set it so that both of my drop down lists will have the same width (I'd prefer the width to be very long, so that even the longest item won't be truncated).

© Stack Overflow or respective owner

Related posts about html

Related posts about dropdownlist