我有一个选择框,我已经添加了一些格式,这在我的机器上看起来很好(mac os,运行黑暗模式或浅色模式)在 safari 和 chrome 上它对我来说看起来是一样的,黑色字体在较亮的背景上。但是在我同事的机器上(Windows 上的 chrome)它看起来是白色的。我该如何解决这个问题以及如何专门针对 css 中下拉列表的外观?
<select class="dark-input">
<option>etc</option>
</select>
//shared class with input
.dark-input {
padding: 10px;
color: white;
width: 250px;
box-sizing: border-box;
border: none;
border-radius: 2px;
transition: background-color 0.5s ease;
background: #ffffff1a;
}
//format Select box
select.dark-input {
-webkit-appearance: none;
-moz-appearance: none;
appearance: none;
padding: 10px;
}
最佳答案
Option Select box showing different color in different Machine Like (Window, Ubuntu safari and) etc. Because of it's HTML default Select box, so that u need to create custom Select design box using JS..... just go here :https://www.w3schools.com/howto/tryit.asp?filename=tryhow_custom_select
关于html - 选择下拉框在某些机器上显示为白色,但不是我的,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/57373443/