开发者

forcing a definite size on a select multiple element

开发者 https://www.devze.com 2023-04-09 18:16 出处:网络
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 t

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.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号