如何更改<select>
中的箭头样式。更改背景,字体颜色或所有边框的内容很简单,但如何更改“箭头”?当我更改字体颜色内容颜色改变但箭头保持黑色。
.language-choice{
margin-top: 10px;
color: #719dd1;
border-color: #719dd1;
-webkit-border-radius: 5px;
-moz-border-radius: 5px;
border-radius: 5px;
border-width: 2px;
}
<select class="language-choice">
<option value="en">English</option>
<option value="pl">Polish</option>
</select>
答案 0 :(得分:2)
你可以尝试这个:
.language-choice{
width: 268px;
padding: 5px;
font-size: 16px;
line-height: 1;
border: 0;
border-color: #719dd1;
-webkit-border-radius: 5px;
-moz-border-radius: 5px;
border-radius: 5px;
border-width: 2px;
height: 34px;
background: url(http://cdn1.iconfinder.com/data/icons/cc_mono_icon_set/blacks/16x16/br_down.png) no-repeat right #ddd;
-webkit-appearance: none;
-moz-appearance: none;
appearance: none;
background-position-x: 244px;
}
答案 1 :(得分:0)
你可以这样试试 -
.selectWrap{
position: relative;
width: 100px;
}
.language-choice{
/*margin-top: 10px;*/
color: #719dd1;
border-color: #719dd1;
-webkit-border-radius: 5px;
-moz-border-radius: 5px;
border-radius: 5px;
border: 2px solid #ccc;
padding: 5px;
width: 100%;
-webkit-box-sizing: border-box;
-moz-box-sizing: border-box;
box-sizing: border-box;
}
span{
background: url('http://www.symantec.com/images/version-3/arrows/info-box-triangle-icon.png') #fff no-repeat center center / 13px 10px;
height:13px;
width: 25px;
position: absolute;
height: calc(100% - 4px);
right: 2px;
top:2px;
border-radius: 0 3px 3px 0;
pointer-events:none;
}
&#13;
<div class="selectWrap">
<span></span>
<select class="language-choice">
<option value="en">English</option>
<option value="pl">Polish</option>
</select>
</div>
&#13;