Created
October 8, 2014 16:49
-
-
Save marjanbonus/dd31242e093e587da588 to your computer and use it in GitHub Desktop.
HTML select element custom arrow
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!DOCTYPE html> | |
<html> | |
<head> | |
<title>custom select</title> | |
<style> | |
.container-width { width: 135px; } | |
.select-wrapper { | |
overflow: hidden; | |
background: url('https://cdn2.iconfinder.com/data/icons/picol-vector/32/arrow_sans_down-16.png') no-repeat 108px 7px; | |
border: 1px solid #888; | |
border-radius: 4px; | |
} | |
select { | |
width: 100%; | |
height: 30px; | |
padding-left: 5px; | |
border: none; | |
outline: none; | |
background: transparent; | |
-webkit-appearance: initial; | |
} | |
@-moz-document url-prefix() { | |
select { | |
width: 115%; | |
} | |
} | |
@media screen and (-ms-high-contrast: active), (-ms-high-contrast: none) { | |
select { | |
width: 115%; | |
} | |
} | |
</style> | |
</head> | |
<body> | |
<div class="container-width"> | |
<div class="select-wrapper"> | |
<select> | |
<option value="option1">custom</option> | |
<option value="option2">select</option> | |
</select> | |
</div> | |
</div> | |
</body> | |
</html> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment