我创建了一个选择框背景颜色。在 chrome 下拉菜单中显示背景颜色,但在 chrome 中显示为白色。我想在 mozilla 下拉菜单中应用背景颜色,就像在 chrome 中一样
select{
background-color:red;
}
<select>
<option>1</option>
<option>2</option>
<option>3</option>
</select>
同样的下拉菜单在 mozilla 中显示为白色
最佳答案
类似的问题已经回答过了。您需要将 -moz-appearance 设置为无。 Why does Firefox set a background color on the select arrow button when I set a custom border or background color?
select {
border: 1px solid silver;
-webkit-appearance: none;
-moz-appearance: none;
padding-right: 25px;
background-color: red
}
关于html - 更改 mozilla 中选择框下拉菜单的颜色,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/42501177/