How to add horizontal and vertical scrollbar for <select> tag
I want to show vertical scrollbar in <select>
tag because there is more opt开发者_如何学Cion so I need scrollbar.
<html>
<body>
<select multiple="yes" style="height: 200px; width: 200px;">
<option>1</option>
<option>1</option>
<option>1</option>
<option>1</option>
<option>1</option>
<option>1</option>
</select>
</body>
</html>
Note the multiple attribute can be omitted in order to only allow one option to be selected.
I suggest to use a custom drop down element if you need styling on the list itself as you don't have much control on styling the default select drop down. The vertical scroll bar should appear when they're more elements than to fit the display area.
精彩评论