Webkit scrollbar not working in selectbox

In the scrollbar, webkit does not work in the single value selection window, but works fine in several selection blocks

CSS ::-webkit-scrollbar { width: 6px; height: 6px; background-color:transparent; } ::-webkit-scrollbar-track { background-color:transparent; width: 6px; } ::-webkit-scrollbar-track-piece { background-color: transparent; } ::-webkit-scrollbar-thumb { background: none green; width: 6px; } HTML // Don't Works <select> <option value="1">One</option> <option value="2">Two</option> <option value="3">Three</option> </select> // Works perfect for this <select size="2"> <option value="1">One</option> <option value="2">Two</option> <option value="3">Three</option> </select> 

How to solve this problem?

+6
source share
1 answer

You cannot solve this problem, at least not yet. You need to specify size 2 for the DOM to find out that you want to see more than two values, CSS is not supported.

I am trying to use "-webkit-scrollbar", "-moz-scrollbar", "-ms-scrollbar", "-o-scrollbar" and the direct property "scrollbar", and I got the same result. Different browsers have different behaviors. If this part is very important to you, you need to use JavaScript or jQuery PLUGINS .

0
source

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


All Articles