How do you replace the arrow button on <select> element with css?

后端 未结 2 1318
深忆病人
深忆病人 2021-01-21 07:46

Trying to style the select element on a form with an image for the dropdown arrow. Dont know if this is possible yet.

2条回答
  •  既然无缘
    2021-01-21 08:36

    Style it with CSS and use pointer events :

    
    

    and the relative CSS is

    label:after {
        content:'\25BC';
        display:inline-block;
        color:#000;
        background-color:#fff;
        margin-left:-17px;   /* remove the damn :after space */
        pointer-events:none; /* let the click pass trough */
    }
    

    use a block with image background if you want to, I'm just using a down arrow here. Here is a ugly fiddle sample: https://jsfiddle.net/1rofzz89/

提交回复
热议问题