When a select multiple element is empty (without any options), the dimensions of the element become zero and shows only the scroll bar , also the element resizes according to the size of the data of the options . How can i create a select multiple element with a definite size which does not change irrespective 开发者_JAVA技巧of the above two factors? Thanks in advance
Use CSS:
select.multiple {
width: 200px;
height: 400px;
}
The above assumes your select has class="multiple"
, but obviously you can set your CSS selector to ID or whatever suits, and of course you'll set the dimensions and units to suit your specific case.
精彩评论