Skip to content Skip to sidebar Skip to footer

Html

I have a tag with many child nodes. I want to keep the width of this drop-down list to a minimum size. However, there are times when the innerHTML of at least one option is very

Solution 1:

Adding a title attribute to each option should do the trick.

<option value="1" title="Long description">Short desc...</option>

Solution 2:

You can set the width of the <select> and the dropdown will extend beyond the width of the select. Try the following:

<select style="width: 30px">
  <option>1</option>
  <option>really long</option>
  <option>even more longer</option>
  <option>This should be long enough to stretch to the endof the page, but the selectis still not very long</option>
</select>

Post a Comment for "Html