Created
November 27, 2013 13:36
-
-
Save ronlobo/7675791 to your computer and use it in GitHub Desktop.
HTML Select styling
This file contains hidden or 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
.select-bg { | |
position: relative; | |
display: inline-block; | |
} | |
select { | |
display: inline-block; | |
padding: 4px 3px 5px 5px; | |
width: 150px; | |
outline: none; | |
color: #74646e; | |
border: 1px solid #C8BFC4; | |
border-radius: 4px; | |
box-shadow: inset 1px 1px 2px #ddd8dc; | |
background-color: #fff; | |
} | |
/* Select arrow styling */ | |
.notIE .select-bg:after { | |
content: ''; | |
width: 23px; | |
height: 23px; | |
position: absolute; | |
display: inline-block; | |
top: 4px; | |
right: 4px; | |
background: url(http://www.stackoverflow.com/favicon.ico) no-repeat right center white; | |
pointer-events: none; | |
} | |
/*target Internet Explorer 9 and Internet Explorer 10:*/ | |
@media screen and (min-width:0\0) { | |
.notIE .select-bg:after | |
{ | |
display:none; | |
} | |
} |
This file contains hidden or 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
<!--[if !IE]> --> <div class="notIE"> <!-- <![endif]--> | |
<label>test</label> | |
<div class="select-bg" /> | |
<select> | |
<option>Apples</option> | |
<option selected>Pineapples</option> | |
<option>Chocklate</option> | |
<option>Pancakes</option> | |
</select> | |
<!--[if !IE]> --></div> <!-- <![endif]--> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment