HTML CSS改变SELECT ARROW的颜色

时间:2016-08-10 10:04:53

标签: html css

我希望将SELECT箭头的颜色更改为蓝色。

有一种简单的方法吗?

SELECT BOX

2 个答案:

答案 0 :(得分:5)

试试这段代码,

<div class="customerStyle">
   <select class="selectCustomer">
       <option value="Jone">Jone</option>
       <option value="Tom">Tom</option>
   </select>
</div>


.customerStyle select {
  background: transparent;
  width: 170px;
  padding: 5px;
  border: 0;
  border-radius: 0;
  height: 35px;
}

.customerStyle {
   background: url("images/arrow.png") no-repeat right #ffffff;
   border: 1px solid #000;
   width: 150px;
   height: 35px;
   overflow: hidden;
 }

为&#34; images / arrow.png&#34;

添加蓝色箭头图像

答案 1 :(得分:5)

&#13;
&#13;
.select_box{
  width: 200px;
  overflow: hidden;
  border: 1px solid #000;
  position: relative;
  padding: 10px 0;
}
.select_box:after{
  width: 0; 
  height: 0; 
  border-left: 6px solid transparent;
  border-right: 6px solid transparent;
  border-top: 6px solid #f00;
  position: absolute;
  top: 40%;
  right: 5px;
  content: "";
  z-index: 98;
 }
.select_box select{
  width: 220px;
  border: 0;
  position: relative;
  z-index: 99;
  background: none;
}
&#13;
<div class="select_box">
 <select>
   <option>Test This Select</option>
   <option>Test This Select</option>
 </select>
</div>
&#13;
&#13;
&#13;