I'm trying to follow a design of a select dropdown-list where:
However, the arrow is not being adjusted at all. It keeps sticking to the right end. Please see attached screenshot for reference.Front End Screenshot
You can also view my codes here
Is there a way to target the specific arrow and apply paddings to it? (Aiming to keep the same padding applied to the input text for both sides)
Thanks!
For vertical padding you can use line-height. If you don't need border, you can specify border and make it the same color as the select element background, it will give you padding appearance. box-shadow can be used to add stroke to the element if really needed.
It is this value that we have to alter. Setting this property to “none” will do the job. It explicitly tells the browser to not assign any other value to that property, which in turn results in the removal of the default arrow icon.
I used border-right property and it worked.
select {
border-right: 16px solid transparent
}
The problem with wrapper element and ":after" is that, it does not toggle the "select" dropdown when you click on the arrow icon.
Working example: https://jsfiddle.net/asaad7/r8sx9m7e/
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With