-1

Hello everyone I have a select menu dropdown, but there are a lot of elements and I would like to make it scrollable. How can this be done?

For example: Example

Tamada
  • 3
  • 2
  • [How to Make a Stack Snippet](https://meta.stackoverflow.com/questions/358992/ive-been-told-to-create-a-runnable-example-with-stack-snippets-how-do-i-do). – zer00ne Apr 19 '23 at 20:24
  • Please provide enough code so others can better understand or reproduce the problem. – Community Apr 19 '23 at 21:50

1 Answers1

0

You can set a fixed height, something like height: 500px, then set overflow-y: scroll. You can also use auto if you would like the scrollbar to hide when the content inside of the menu div does not exceed the height of the div.

.scrollable_dropdown {
  height: 500px;
  /* This can also be auto */
  overflow-y: scroll;
}

Refer to https://stackoverflow.com/a/30379387/21677455 for more information about possible options.

Arc
  • 26
  • 3