我想從HTML <select>元素中刪除下拉箭頭。例如:<select style="width:30px;-webkit-appearance: none;"> <option>2000</option> <option>2001</option> <option>2002</option> ...</select>如何在Opera,Firefox和Internet Explorer中進行操作?
3 回答

慕桂英3389331
TA貢獻2036條經驗 獲得超8個贊
前面提到的解決方案適用于chrome,但不適用于Firefox。
我找到了一個在Chrome和Firefox(不適用于IE)上都可以很好運行的解決方案。將以下屬性添加到SELECTelement的CSS中,并調整邊距頂部以適合您的需求。
select {
-webkit-appearance: none;
-moz-appearance: none;
text-indent: 1px;
text-overflow: '';
}
希望這可以幫助 :)

慕村9548890
TA貢獻1884條經驗 獲得超4個贊
從選擇中刪除下拉箭頭的簡單方法
select {
/* for Firefox */
-moz-appearance: none;
/* for Chrome */
-webkit-appearance: none;
}
/* For IE10 */
select::-ms-expand {
display: none;
}
<select>
<option>2000</option>
<option>2001</option>
<option>2002</option>
</select>
- 3 回答
- 0 關注
- 784 瀏覽
相關問題推薦
添加回答
舉報
0/150
提交
取消