如何从下拉列表(选择元素)中删除默认箭头图标?
问题描述:
我想从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;
}