我正在处理的网站已从具有以下内容的框中删除了下拉箭头:
select {
-webkit-appearance: none;
-moz-appearance: none;
appearance: none;
}
我需要把它加回去,但到目前为止我试过的都没有用
select {
-webkit-appearance: none;
-moz-appearance: none;
appearance: none;
}
select.diff {
/* Aswell as normal, I have also tried revert & unset */
-webkit-appearance: normal;
-moz-appearance: normal;
appearance: normal;
}
<select>
<option>Trains</option>
<option>Planes</option>
<option>Automobiles</option>
</select>
<select class="diff">
<option>Oranges</option>
<option>Pears</option>
<option>Apple</option>
</select>
最佳答案
你需要设置为menulist
select {
-webkit-appearance: none;
-moz-appearance: none;
appearance: none;
}
select.diff {
-webkit-appearance: menulist;
-moz-appearance: menulist;
appearance: menulist;
}
<select>
<option>Trains</option>
<option>Planes</option>
<option>Automobiles</option>
</select>
<select class="diff">
<option>Oranges</option>
<option>Pears</option>
<option>Apple</option>
</select>
检查外观
选项here
关于html - 无法重置 CSS 外观属性,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/39254856/