html - 无法重置 CSS 外观属性

标签 html css html-select

我正在处理的网站已从具有以下内容的框中删除了下拉箭头:

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/

相关文章:

javascript - 数据不会出现 : Cannot read property 'slice' of undefined

html - 如何在 bootstrap-datetimepicker 中调整输入日期时间的大小?

html - 浏览器选项卡未显示完整 URL?

html - 如何在 Xaringan 演示文稿中调整图像大小?

php - 在选择框中按名称排序在谷歌浏览器和 IE 中不起作用

php - Jquery html() 而不是 val()

javascript - 内联 JavaScript : can it retrieve reference to the element it was invoked from?

javascript - 语法错误代码笔全 View

css - 当源代码用 CSS 编写时,无法看到图像

javascript - Angularjs <select> 在 ng-options 更新时不调整高度