How to style selection?

I am on mac running firefox. I have a website, and in the drop-down list, select a funny style:

alt text

When I look at other sites in the same browser, they look different:

alt text

Or even in my code here: jsFiddle

What could be the reason that my site will show how this happens, because, as I understand it, you have very little control over the display of the selection fields?

thank

+3
source share
3 answers

Do you use CSS for formatting <select>? Or CSS reset? If you use some rules, such as borderor background, the default style disappears and you get this gray square. You must remove these CSS settings.

+4

. , CSS .

, jQuery, : Custom Select Box, .

+1

The second example is displayed using the select system view. The first of them is not like choosing a system, because some custom style is applied, which no more than just resets the system view.

In general, it is not possible to efficiently create HTML input fields other than text fields. To do this, developers typically reimplement input elements using complex HTML, as suggested by Ian Devlin.

+1
source

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


All Articles