Dropdown size on selection item

How do you set the size of a dropdown on a select element? Not the select element itself, but part of its drop-down list when you click on the parameters?

______________ |____________| input box | | | | | | |____________| size of drop down box containing options 

Thank you for your help!

+4
source share
3 answers

If you just want to resize to increase the number of options displayed, use HTML: <select size="3" ...

But if you want to resize the pop-up than others said, you cannot do this with CSS.

The best workaround is to use one of the many jQuery plugins. See this answer .

+4
source

This cannot be done using the standard SELECT element. Styling support for SELECT and OPTION is very limited.

You can use a few scripts to replace SELECT with UL, which you can perfectly style. Checkout http://v2.easy-designs.net/articles/replaceSelect/ or http://v2.easy-designs.net/articles/replaceSelect2/ for examples.

+3
source

You cannot reliably. Some browsers may have their own way of doing this (but don't ask me). The only option is to create a custom drop-down control, possibly using a drop-down div, similar to how jQuery autocomplete works, and not use standard HTML SELECT.

+1
source

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


All Articles