Custom drop-down arrow
P粉986937457
2023-08-17 17:52:04
<p>Is it possible to change the dropdown arrow of the select tag to a custom arrow consisting of 4 elements. I want it to look like this: 3 horizontal lines on the left and a downward arrow on the right</p>
<p>I successfully achieved this effect with one element (a horizontal line)</p>
<pre class="brush:php;toolbar:false;">.select-wrapper::before {
content: "";
position: absolute;
top: 50%;
display: block;
width: 9px;
height: 2px;
background: black;
}</pre></p>
I believe you want to achieve a similar effect to this CodePen. The code comes almost entirely from SVNM's answer to this question
Modification from this answer
SampleHTML
CSS
select { -webkit-appearance: none; -moz-appearance: none; background: transparent; background-image: url("https://paul7dxb.github.io/hosted-assets/SomePNGs/arrow.png"); background-repeat: no-repeat; background-size: 40px 20px; background-position-x: 80%; background-position-y: 50%; border: 1px solid #dfdfdf; border-radius: 2px; margin-right: 2rem; padding: 1rem; padding-right: 2rem; }