什么是正确的“-moz-appearance"?隐藏 <select> 的下拉箭头的值元素 [英] What is the correct "-moz-appearance" value to hide dropdown arrow of a <select> element

查看:29
本文介绍了什么是正确的“-moz-appearance"?隐藏 <select> 的下拉箭头的值元素的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试仅使用 CSS 设置 <select> 元素的下拉箭头的样式,它在 Chrome/Safari 中完美运行:

I'm trying to style the dropdown arrow of a <select> element with CSS only , it works perfectly in Chrome/Safari:

select {
  -webkit-appearance: button;
  -webkit-border-radius: 2px;
  -webkit-box-shadow: 0px 1px 3px rgba(0, 0, 0, 0.1);
  -webkit-padding-end: 20px;
  -webkit-padding-start: 2px;
  -webkit-user-select: none;

  background-image: url('./select-arrow1.png') ;
  background-position: center right;
  background-repeat: no-repeat;
  border: 1px solid #AAA;
  margin: 0;
  padding-top: 2px;
  padding-bottom: 2px;
  width: 200px;
}

呈现精美如此处所见

按照这个逻辑,我唯一需要做的就是将所有 -webkit-* 内容添加为 -moz-* :

By that logic, the only thing I had to do to make it work in Firefox was to add all -webkit-* stuff as -moz-* :

-moz-appearance: button;
-moz-border-radius: 2px;
-moz-box-shadow: 0px 1px 3px rgba(0, 0, 0, 0.1);
-moz-padding-end: 20px;
-moz-padding-start: 2px;
-moz-user-select: none;

它适用于 99%,唯一的问题是默认的下拉箭头不会消失,而是停留在背景图像的顶部 如这里所见

It works for 99%, the only problem is that the default dropdown arrow doesn't go away, and stays on top of the background image as seen here

看起来 -moz-appearance: button; 不适用于

发送“验证码”获取 | 15天全站免登陆