0

I have a simple select tag in html without any options inside it. When I open the html file in one machine the menu opened is showing in white color as a background.

Dropdown with White meny

and the same html file and with same select tag without any options, if i open in another machine then the menu opened is showing in black color.

dropdown with black menu

Why the color is different between these two machines and what could be done to remove the black color and show white color.

Note: In both machines Microsoft Edge (chromium) browser is used.

Ambareesh
  • 55
  • 1
  • 5
  • https://stackoverflow.com/questions/12836227/change-select-box-option-background-color – mplungjan Oct 29 '21 at 07:19
  • This will set CSS rule for select element with options, but in my case it i just empty select without any child option elements. The menu dropdown color alone is different in this case. When options are added the style is consistent between two machines – Ambareesh Oct 29 '21 at 08:30
  • According to your description, I reproduced the problem in the same version of Edge. But I found that the operating system versions are inconsistent (`win10 20H2 19042.928` and `win10 20H2 19042.1288`). So I want to know if you are testing in the same operating system. – Xudong Peng Nov 01 '21 at 07:22
  • @XudongPeng unfortunately we couldn't chk in our machines are those have privige access. :-( and I would like to know this issue can be resolved using css? – Ambareesh Nov 01 '21 at 07:45
  • @XudongPeng one is running in VMWare - Windows Server 2016 - in this machine only i could see the dropdown in black. How can we fix this using CSS – Ambareesh Nov 01 '21 at 07:55
  • I did some tests on this, and I am afraid that this issue cannot be solved with style. You have to add an empty option to it. – Xudong Peng Nov 01 '21 at 09:18
  • Yes, looks like I have to make changes in entire application.. Thank you @XudongPeng – Ambareesh Nov 01 '21 at 09:52
  • We finally disabled the dropdown so that it is not clickable anymore – Ambareesh Nov 02 '21 at 13:25

1 Answers1

0

The two machines may have different versions of Chrome installed. You can check the browser version by looking at chrome://version/. So the background color of the selected component is different.

Solution: Use css rules to override the background color of the default selected component, and ensure that the browser versions of the two machines are the same.

Michael An
  • 181
  • 9