如何从下拉列表(选择元素)中删除默认箭头图标? [英] How to remove the default arrow icon from a dropdown list (select element)?
本文介绍了如何从下拉列表(选择元素)中删除默认箭头图标?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我想从HTML <select>
元素中删除下拉箭头.例如:
I want to remove the dropdown arrow from a HTML <select>
element. For example:
<select style="width:30px;-webkit-appearance: none;">
<option>2000</option>
<option>2001</option>
<option>2002</option>
...
</select>
如何在Opera,Firefox和Internet Explorer中进行操作?
How to do it in Opera, Firefox and Internet Explorer?
推荐答案
无需进行黑客攻击或溢出. IE上的下拉箭头有一个伪元素:
There's no need for hacks or overflow. There's a pseudo-element for the dropdown arrow on IE:
select::-ms-expand {
display: none;
}
这篇关于如何从下拉列表(选择元素)中删除默认箭头图标?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文