Apparently this doesn't work:
select[multiple]{
height: 100%;
}
it makes the select have 100% page height...
auto
doesn't work either, I still get the vertical scrollbar.
Any other ideas?
Apparently this doesn't work:
select[multiple]{
height: 100%;
}
it makes the select have 100% page height...
auto
doesn't work either, I still get the vertical scrollbar.
Any other ideas?
The way a select box is rendered is determined by the browser itself. So every browser will show you the height of the option list box in another height. You can't influence that. The only way you can change that is to make an own select from the scratch.
You can only do this in Javascript/JQuery, you can do it with the following JQuery (assuming you've gave your select an id of multiselect):
Demo: http://jsfiddle.net/AZEFU/
https://jsfiddle.net/maars/ou5f3jzy/
I know the question is old, but how the topic is not closed I'll give my help.
The attribute "size" will resolve your problem.
Example:
You can do this using the
size
attribute in theselect
tag. Supposing you have 8 options, then you would do it like:I had this requirement recently and used other posts from this question to create this script: