Limiting the length of the list of list fields - adding scroll bars

When I use the html select box, which contains about 50 elements, I get a very long list that appears completely. Instead, I would like to use scrollbars. how to do it?

+4
source share
3 answers

You need to use CSS, especially height and overflow:

CSS

.select{ height:100px; overflow:scroll; } 

HTML

 <select class="select"></select> 

If you need something more specific, ask!

+5
source

This is not possible in HTML. See HTML Selection Window Height (dropdown menu)

There are other ways to achieve this, although javascript or jQuery, with links on this page to some jQuery plugins that create a "fake" html flag that looks and behaves as one, but can have a set height.

+4
source

It is not possible to set the number of visible items for one value selection window. There is a size attribute, but this will convert the drop-down list to multiple select lists.

0
source

Source: https://habr.com/ru/post/1347215/


All Articles