Custom Select Box Dropdown Styling
A Pen by FrankieDoodie on CodePen.
Custom Select Box Dropdown Styling
A Pen by FrankieDoodie on CodePen.
<div class="box"> | |
<select> | |
<option>Option 1</option> | |
<option>Option 2</option> | |
<option>Option 3</option> | |
<option>Option 4</option> | |
<option>Option 5</option> | |
</select> | |
</div> |
body { | |
margin: 0; | |
padding: 0; | |
background-color: #004882; | |
} | |
.box { | |
position: absolute; | |
top: 50%; | |
left: 50%; | |
transform: translate(-50%, -50%); | |
} | |
.box select { | |
background-color: #0563af; | |
color: white; | |
padding: 12px; | |
width: 250px; | |
border: none; | |
font-size: 20px; | |
box-shadow: 0 5px 25px rgba(0, 0, 0, 0.2); | |
-webkit-appearance: button; | |
appearance: button; | |
outline: none; | |
} | |
.box::before { | |
content: "\f13a"; | |
font-family: FontAwesome; | |
position: absolute; | |
top: 0; | |
right: 0; | |
width: 20%; | |
height: 100%; | |
text-align: center; | |
font-size: 28px; | |
line-height: 45px; | |
color: rgba(255, 255, 255, 0.5); | |
background-color: rgba(255, 255, 255, 0.1); | |
pointer-events: none; | |
} | |
.box:hover::before { | |
color: rgba(255, 255, 255, 0.6); | |
background-color: rgba(255, 255, 255, 0.2); | |
} | |
.box select option { | |
padding: 30px; | |
} |
<link href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.7.0/css/font-awesome.min.css" rel="stylesheet" /> |