# Width of drop down in a combo box

**URL:** <https://forum.kirupa.com/t/width-of-drop-down-in-a-combo-box/184257>\
**Category:** Uncategorized\
**Created:** [April 3, 2006, 8:08pm UTC](https://forum.kirupa.com/t/width-of-drop-down-in-a-combo-box/184257 "2006-04-03T20:08:31Z")\
**Posts on this page:** 10\
**Page:** 1

<div class="post-metadata">

**Author:** ![sameerzs](https://yyz1.discourse-cdn.com/flex011/user_avatar/forum.kirupa.com/sameerzs/32/810_2.png) [@sameerzs](https://forum.kirupa.com/u/sameerzs)\
**Post date:** [April 3, 2006, 8:08pm UTC](https://forum.kirupa.com/t/width-of-drop-down-in-a-combo-box/184257/1 "2006-04-03T20:08:31Z")

</div>

is there a way to increase the width of only the drop down in a combo box???

using javascript and without using active widgets…

:d:

---

<div class="post-metadata">

**Author:** ![Jeff\_Wheeler](https://avatars.discourse-cdn.com/v4/letter/j/59ef9b/32.png) [@Jeff\_Wheeler](https://forum.kirupa.com/u/Jeff_Wheeler)\
**Post date:** [April 4, 2006, 3:09am UTC](https://forum.kirupa.com/t/width-of-drop-down-in-a-combo-box/184257/2 "2006-04-04T03:09:19Z")

</div>

What? I don’t think I understand?

Can you not just use the css property [font=monospace]width[/font]?

---

<div class="post-metadata">

**Author:** ![simplistik](https://yyz1.discourse-cdn.com/flex011/user_avatar/forum.kirupa.com/simplistik/32/7747_2.png) [@simplistik](https://forum.kirupa.com/u/simplistik)\
**Post date:** [April 4, 2006, 5:17am UTC](https://forum.kirupa.com/t/width-of-drop-down-in-a-combo-box/184257/3 "2006-04-04T05:17:16Z")

</div>

nah… he wants the selection box to be one size then the sub items another, i believe.

---

<div class="post-metadata">

**Author:** ![sameerzs](https://yyz1.discourse-cdn.com/flex011/user_avatar/forum.kirupa.com/sameerzs/32/810_2.png) [@sameerzs](https://forum.kirupa.com/u/sameerzs)\
**Post date:** [April 4, 2006, 8:34am UTC](https://forum.kirupa.com/t/width-of-drop-down-in-a-combo-box/184257/4 "2006-04-04T08:34:11Z")

</div>

See when you create a combo box and set the width say 80 px, then you have items in dropdown that exceed the given width and most of the text is hidden…

> \<select name=“sel1” style=“width:80px;”\>  
> \<option\>ABCDEF\</option\>  
> \<option\>uiysudygfksfg876976sd\</option\>  
> \<option\>uiysudygfksfg876976sd\</option\>  
> \<option\>uiysudygfksfg876976sd\</option\>  
> \<option\>uiysudygfksfg876976sd\</option\>  
> \</select\>

now what i want to know is, is there anyway where i can increase the width of only the dropdown without altering the width of the combo box.

---

<div class="post-metadata">

**Author:** ![Jeff\_Wheeler](https://avatars.discourse-cdn.com/v4/letter/j/59ef9b/32.png) [@Jeff\_Wheeler](https://forum.kirupa.com/u/Jeff_Wheeler)\
**Post date:** [April 4, 2006, 9:46pm UTC](https://forum.kirupa.com/t/width-of-drop-down-in-a-combo-box/184257/5 "2006-04-04T21:46:29Z")

</div>

Try changing the width of all the options?

Worth a shot…

---

<div class="post-metadata">

**Author:** ![Ankou](https://yyz1.discourse-cdn.com/flex011/user_avatar/forum.kirupa.com/ankou/32/1351_2.png) [@Ankou](https://forum.kirupa.com/u/Ankou)\
**Post date:** [April 5, 2006, 3:21am UTC](https://forum.kirupa.com/t/width-of-drop-down-in-a-combo-box/184257/6 "2006-04-05T03:21:02Z")

</div>

> [@nokrev](#):
>
> Try changing the width of all the options?
> 
> Worth a shot…

If I remember right that will work in Firefox but not in IE.

The only thing I could thik of is if you went with something like the auto suggest feature (or whatever you want to call it) at Google Suggest:

> **[Google](https://www.google.com/webhp?complete=1&hl=en)**
>
> Search the world's information, including webpages, images, videos and more. Google has many special features to help you find exactly what you're looking for.

Start typing in the box and you’ll get some suggestions. Something like that using Javascript to output your options from a select list is possible, but it’s probably more work that it’s worth.

I’m not sure how long your options will be but could you shirnk the text a little and still have it fit in an 80px wide select list?

---

<div class="post-metadata">

**Author:** ![sameerzs](https://yyz1.discourse-cdn.com/flex011/user_avatar/forum.kirupa.com/sameerzs/32/810_2.png) [@sameerzs](https://forum.kirupa.com/u/sameerzs)\
**Post date:** [April 5, 2006, 10:33am UTC](https://forum.kirupa.com/t/width-of-drop-down-in-a-combo-box/184257/7 "2006-04-05T10:33:59Z")

</div>

mmm no i cannot decrease the text… its for a web application and the client has really long options tht cannot be shortened… ya it works fine in firefox but in ie it does not ☹

---

<div class="post-metadata">

**Author:** ![ditt0](https://avatars.discourse-cdn.com/v4/letter/d/90db22/32.png) [@ditt0](https://forum.kirupa.com/u/ditt0)\
**Post date:** [April 6, 2006, 4:24am UTC](https://forum.kirupa.com/t/width-of-drop-down-in-a-combo-box/184257/8 "2006-04-06T04:24:36Z")

</div>

Simulate a combo box by creating a dropdown menu.  
You can’t alter the width of the options only, the combo is a control. Browsers don’t know how to handle in depth customization of controls.

---

<div class="post-metadata">

**Author:** ![kernel\_flash](https://avatars.discourse-cdn.com/v4/letter/k/a87d85/32.png) [@kernel\_flash](https://forum.kirupa.com/u/kernel_flash)\
**Post date:** [April 6, 2006, 4:52am UTC](https://forum.kirupa.com/t/width-of-drop-down-in-a-combo-box/184257/9 "2006-04-06T04:52:33Z")

</div>

I think that’s not possible changing the width of drop-down layer without changing the width of combo-box as a whole. I have encountered such thing.

What ditto said can be employed if the items in your combo-box aren’t too many.

---

<div class="post-metadata">

**Author:** ![sameerzs](https://yyz1.discourse-cdn.com/flex011/user_avatar/forum.kirupa.com/sameerzs/32/810_2.png) [@sameerzs](https://forum.kirupa.com/u/sameerzs)\
**Post date:** [April 6, 2006, 9:19am UTC](https://forum.kirupa.com/t/width-of-drop-down-in-a-combo-box/184257/10 "2006-04-06T09:19:37Z")

</div>

it works perfectly fine in firefox but not in IE… this browser compatibility thing is driving me nuts …
