Skip to content Skip to sidebar Skip to footer

Adjust The Height Of The List In Dropdown Box

Possible Duplicate: height of the dropdown box display hi how can I adjust the height of the list in the dropdown because I have too many values loaded in the drop down box. For

Solution 1:

Do you mean?:

 <select size="234">

Solution 2:

Use the following code:

<select size="10" id="items">
    <option value="a1">A1</option>
    <option value="b1">B1</option>
    <option value="c1">C1</option>
    <option value="d1">D1</option>
    <option value="e1">E1</option>
    <option value="a2">A2</option>
    <option value="b2">B2</option>
    <option value="c2">C2</option>
    <option value="d2">D2</option>
    <option value="e2">E2</option>
</select>

Where 10 is the number of items to show at one time. Be sure to be considerate of people with small resolutions who may not be able to see all of the items if you make it too large. Please consult the following link for more information about this setting:

http://www.w3schools.com/tags/att_select_size.asp

EDIT:

The above code will make the select look like a list box. You cannot control the size of the select object and still keep it looking the same. Because it is an application level control, the web browser renders it and does not allow for this setting. For more information, see the following Stack Overflow page that features the same question:

Height of an HTML select box (dropdown)


Post a Comment for "Adjust The Height Of The List In Dropdown Box"