Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Limiting the displayed height of a select drop-down

Tags:

html

css

select

I have a <select> with a lot of <option>'s. Is there any way to limit the height of the displayed <select> when opened?

like image 849
Josh Smith Avatar asked Dec 16 '10 03:12

Josh Smith


People also ask

How do I change the height of a select drop down?

It's not possible to change height of a select dropdown because that property is browser specific.

How do I limit the size of a drop down list in HTML?

It is not possible to limit the number of visible elements in the select dropdown (if you use it as dropdown box and not as list). But you could use javascript/jQuery to replace this selectbox with something else, which just looks like a dropdown box. Then you can handle the height of dropdown as you want.


1 Answers

the size limit is controlled by the browser and not something you can alter.

See this answer: Height of an HTML select box (dropdown)

like image 178
scunliffe Avatar answered Sep 29 '22 09:09

scunliffe