【发布时间】:2020-12-18 13:48:48
【问题描述】:
我能够自定义下拉菜单(代码如下):
select {
padding: 1em;
width: 130%;
border-radius: .2em;
border: 1px solid #acacac;
color: #181820;
appearance: none;
-webkit-appearance: none;
-moz-appearance: none;
-ms-appearance: none;
background: url('https://cdn1.iconfinder.com/data/icons/arrows-vol-1-4/24/dropdown_arrow-512.png');
background-repeat: no-repeat;
background-size: 15px 15px;
background-position: right;
background-origin: content-box;
}
【问题讨论】:
-
在这里您可以找到解决方案 - stackoverflow.com/questions/1895476/…
-
@NikhilSingh 它只说
<select>而不是 ` 我一直在寻找如何设置option的样式到目前为止select只能在 CSS 中设置样式 -
@sagar 谢谢,我发现它也不能在 mozilla 上使用 CSS 设置样式。