This won’t work:
<select size="2">
<option>Mars</option>
<option>Earth</option>
<option>Jupiter</option>
</select>
It’s not possible to set the size-attribute of select to 2 or 3. Any other value will work fine. Is there a solution? And why isn’t this possible?
Jquerys $('select').attr('size', '2'); won’t work either.
Tested with Safari 5.1.7
Seems like that behavior isn’t necessarily part of the specifications, at least in sitepoint:
http://reference.sitepoint.com/html/select/size
You can use
heightcss to adjust it though as you need.http://jsfiddle.net/uteb6/10/