Make multiple-select to adjust its height to fit options without scroll bar

前端 未结 16 990
说谎
说谎 2020-12-24 03:59

Apparently this doesn\'t work:

   select[multiple]{
     height: 100%;
   }

it makes the select have 100% page height...

auto

16条回答
  •  隐瞒了意图╮
    2020-12-24 04:50

    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.

提交回复
热议问题