Style SELECT (Pure CSS)
Style <select> element using pure CSS. Full support in Firefox, Chrome, IE 10+ and graceful degradation for other browsers.
by Luca Detomi
HTML
<form>
<select>
<option>Item One</option>
<option>Item Two</option>
</select>
</form>
CSS
body {
font-family: Arial, sans-serif;
font-size: 12px;
}
select {
border: 1px solid #ccc;
height: 26px;
line-height: 18px;
margin: 0;
padding: 3px;
background: transparent none no-repeat;
cursor: pointer;
}
@media screen and (min-width:0) {
/* for relatively modern browsers including IE 8+ */
select {
border-radius: 4px;
}
}
@media screen and (-webkit-min-device-pixel-ratio:0) {
/* for Webkit */
select {
-webkit-appearance: none;
background-position: right center;
padding: 3px 32px 3px 5px;
}
}
@-moz-document url-prefix() {
/* for Firefox */
select {
-moz-appearance: none;
text-indent: 0.01px;
text-overflow: "";
background-position: right center;
padding-right: 16px;
}
/* hides the dotted outline on focus in FF (See SO#3773430) */
select:-moz-focusring {
color: transparent;
text-shadow: 0 0 0 #000;
}
}
@media screen and (-ms-high-contrast: active), (-ms-high-contrast: none) {
/* for IE10+ */
select::-ms-expand {
display: none;
}
select {
background-position: right center;
padding-right: 30px;
}
}