我测试了这个CSS,以一种风格制作选择框:
select::-ms-expand {
width:12px;
border:none;
background:#fff;
}
但是你可以看到仍有差异。
有没有办法让Select框在所有浏览器中看起来都一样?
答案 0 :(得分:1)
所以你想要做这样的事情
<强> HTML 强>
<div class="select-style">
<select>
<option value="volvo">Volvo</option>
<option value="saab">Saab</option>
<option value="mercedes">Mercedes</option>
<option value="audi">Audi</option>
</select>
</div>
<强> CSS 强>
.select-style {
padding: 0;
margin: 0;
border: 1px solid #ccc;
width: 120px;
border-radius: 3px;
overflow: hidden;
background-color: #fff;
background: #fff url("https://lh3.ggpht.com/O6M43xfWwf_sXtZk_3wv53tGmG6Y-Dtod3_gY6IyuJvEmzhYAcwuNxR1yqAJ9Zacu8vynktJ-w=w16") no-repeat 90% 50%;
}
.select-style select {
padding: 5px 8px;
width: 130%;
border: none;
box-shadow: none;
background-color: transparent;
background-image: none;
-webkit-appearance: none;
-moz-appearance: none;
appearance: none;
}
.select-style select:focus {
outline: none;
}