To customize the appearance of a select
element, you can use appearance: none
and then style it using pseudo elements like :before
and :after
.
Check out the code snippet below for an example:
.select-wrapper {
width: 300px;
position: relative;
}
select {
-webkit-appearance: none;
appearance: none;
padding: 4px 20px 4px 10px;
border-radius: 6px;
width: 100%;
background: linear-gradient(to bottom, #fcfcfc 0%,#ececec 100%);
}
.select-wrapper:before {
content: '';
position: absolute;
top: 60%;
right: 8px;
transform: translateY(-50%);
border-right: 4px solid transparent;
border-left: 4px solid transparent;
border-top: 4px solid #777;
}
.select-wrapper:after {
content: '';
position: absolute;
top: 35%;
right: 8px;
transform: translateY(-50%);
border-right: 4px solid transparent;
border-left: 4px solid transparent;
border-bottom: 4px solid #777;
}
select:focus {
outline: none;
}
<div class="select-wrapper">
<select>
<option value="0" selected>Select Option</option>
<option value="1">1</option>
<option value="2">2</option>
<option value="3">3</option>
</select>
</div>
I hope this solution is helpful for you!