如何在<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>
发布于 2015-10-01 17:34:24
你可以试试这个:
.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;
}DEMO FIDDLE
发布于 2015-10-01 17:34:36
你可以这样试一下-
.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;
} <div class="selectWrap">
<span></span>
<select class="language-choice">
<option value="en">English</option>
<option value="pl">Polish</option>
</select>
</div>
https://stackoverflow.com/questions/32883817
复制相似问题