Can someone confirm that its not possible to change the height of a dropdown that is shown when you click on a select box.
The size attribute of the select makes it look like a list, the height attribute in the CSS doesnt do much good either.
Can someone confirm that its not possible to change the height of a dropdown that is shown when you click on a select box.
The size attribute of the select makes it look like a list, the height attribute in the CSS doesnt do much good either.
Confirmed.
The part that drops down is set to either:
x entries (with scrollbars to see remaining), where x is
For (3) above you can see the results in this JSFiddle
I know that it's not the best practice for changing the height of the select, but there is a code that maybe helps you to change the height.
Using the size attribute of the select tag:
<select onfocus='this.size=6;' onblur='this.size=6;' onfocusout='this.size=null;' onchange='this.size=6; this.blur();'>
<option>Option 1</option>
<option>Option 2</option>
<option>Option 3</option>
<option>Option 4</option>
<option>Option 5</option>
<option>Option 6</option>
<option>Option 7</option>
<option>Option 8</option>
<option>Option 9</option>
<option>Option 10</option>
<option>Option 11</option>
<option>Option 12</option>
<option>Option 13</option>
<option>Option 14</option>
<option>Option 15</option>
</select>
You can change the height of one.
Don't use height="500"(Just an example number). Use the style.
You can use <style>tag or just use this:
<!DOCTYPE html>
<html>
<body>
<select id="option" style="height: 100px;">
<option value="1">Option 1
<option value="2">Option 2
</select>
</body>
</html>
I spotlight the change:
<select id="option" style="height: 100px;">
And even better...
style="height: 100px;">
You see that?
Please up vote if it's helpful!