Skip to content

Instantly share code, notes, and snippets.

@ronlobo
Created November 27, 2013 13:36
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ronlobo/7675791 to your computer and use it in GitHub Desktop.
Save ronlobo/7675791 to your computer and use it in GitHub Desktop.
HTML Select styling
.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;
}
}
<!--[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