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>
How to do it in Opera, Firefox and Internet Explorer?
There's no need for hacks or overflow. There's a pseudo-element for the dropdown arrow on IE:
Simple way to remove drop down arrow from select
Try this it works for me,
You can not hide but using overflow hidden you can actually make it disappear.
As I answered in Remove Select arrow on IE
In case you want to use the class and pseudo-class:
.simple-control
is your css class:disabled
is pseudo classYou cannot do this with a fully functional cross browser support.
Try taking a div of 50 pixels suppose and float a desired drop-down icon of your choice at the right of this
Now within that div, add the select tag with a width of 55 pixels maybe (something more than the container's width)
I think you'll get what you want.
In case you do not want any drop icon at the right, just do all the steps except for floating the image at the right. Set outline:0 on focus for the select tag. that's it
Works for all browsers and all versions:
JS
HTML