Firefox中的css问题

时间:2017-03-11 16:54:52

标签: html css html5 css3 firefox

我无法删除firefox中的selectpicker图标的边框和背景,但它适用于chrome

enter image description here

enter image description here

这是我的css:

  border: none;
  background: none;

和我的HTML代码:

 <li>
      <select class="selectpicker">
      <option class="no" selected="selected">EN</option>
      <option class="no">VI</option>
      </select>
 </li>

1 个答案:

答案 0 :(得分:0)

您可以将选择的外观设置为无,并添加其他选择包装以显示自定义三角形。例如:

&#13;
&#13;
.select-wrap {
  position: relative;
  display: inline-block;
}
.select-wrap:after {
  content: '';
  position: absolute;
  top: 7px;
  right:0;
  width: 0;
  height: 0;
  border-style: solid;
  border-width: 8px 4px 0 4px;
  border-color: #f00 transparent transparent transparent;
}
select{
  -moz-appearance: none;
  -webkit-appearance: none;
  appearance: none;
  background: transparent;
  border-width: 0;
  padding-right: 12px;
}
&#13;
<!DOCTYPE html>
<html>
<head>
</head>
<body>
  <div class="select-wrap">
    <select>
      <option value="opt1">option 1</option>
      <option value="opt2">option 2</option>
      <option value="opt3">option 3</option>
      <option value="opt4">option 4</option>
    </select>
  </div>
</body>
</html>
&#13;
&#13;
&#13;