CSS Selects- 50% Showing
by Victor
HTML
<div class="dropdown">
<select>
<option value="">Some Text</option>
<option value="">Some More Text2</option>
<option value="">Some More More More Longer Text</option>
</select>
</div>
CSS
.dropdown{
width:150px;
border: 1px solid #cfcfcf;
height: auto;
border-radius: 5px;
padding:3px 4px 4px;
position: relative;
z-index: 0;
overflow:hidden;
}
.dropdown select{
border: none;
background-color: transparent;
outline: none;
padding: 0;
width:150px;
/* background: url(http://i57.tinypic.com/nnmgpy_th.png) no-repeat right; */
/* background-position: 55%; */
}
/* not 100% sure this next option rule is needed */
.dropdown option {
width:150px
}
/* this places an arbitrary element inside the dropdown but before it's children elements */
/* We use it to cover half the select box as well as display the custom arrow */
.dropdown:before {
height:29px;
width:75px;
display:block;
content:'';
position:absolute;
top:0;
right:3px;
background: url(http://i57.tinypic.com/nnmgpy_th.png) #fff no-repeat right;
pointer-events:none;
}