Created
July 5, 2013 09:50
-
-
Save Demwunz/5933429 to your computer and use it in GitHub Desktop.
custom select box styling for webkit browsers
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
<span class="default-dropdown"> | |
<select> | |
<option value="a">Chumba</option> | |
<option value="b">Wumba</option> | |
</select> | |
</span> |
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
.default-dropdown { | |
display: inline-block; | |
position: relative; | |
&:after { | |
border-color: blue transparent transparent transparent; | |
border-style: solid; | |
border-width: 5px; | |
content: ''; | |
position: absolute; | |
pointer-events: none; | |
top: 14px; | |
right: 8px; | |
z-index: 1000; | |
} | |
select { | |
color: #ff0; | |
display: inline-block; | |
font-weight: 700; | |
min-width: 150px; | |
padding: 10px 18px 10px 10px; /* Right padding to account for triangle decoration */ | |
outline: none; | |
-webkit-appearance: none; | |
option { | |
border: 2px solid blue; | |
color: blue; | |
font-weight: 700; | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment