width of select tag

Do you have a question? Post it now! No Registration Necessary.  Now with pictures!

Threaded View
I want to control the width of drop-downs on my page.
That is, in case the size of the text is too large then the entire
text should only be shown on clicking the combo box.
Any one has any idea as to how this can be done.
I tried style="Width:100px" ... this truncates the text beyond the
specified width.
I dont want that to happen.
Please help.

Re: width of select tag

huzefak@mastek.com (huzefa) wrote:

Quoted text here. Click to load it

Universally, it can't. Some OS/browser combinations use the same width
for the always visible box and the expanded list. Others will use
different widths.

Quoted text here. Click to load it

In some browsers it does, in others it does not.

There's no way of confining the width of the always visible box
without confining the width of the expanded list in at least some

Shorten the text in the list or rethink your design so that it is more
flexible and allows for variously sized select boxes.


"My theories appal you, my heresies outrage you,
 I never answer letters and you don't like my tie."  - The Doctor

Site Timeline