How to remove the arrow from a select element in Firefox

后端 未结 30 1259
北恋
北恋 2020-11-22 15:58

I\'m trying to style a select element using CSS3. I\'m getting the results I desire in WebKit (Chrome / Safari), but Firefox isn\'t playing nicely (I\'m not ev

30条回答
  •  伪装坚强ぢ
    2020-11-22 16:33

    Update: this was fixed in Firefox v35. See the full gist for details.


    Just figured out how to remove the select arrow from Firefox. The trick is to use a mix of -prefix-appearance, text-indent and text-overflow. It is pure CSS and requires no extra markup.

    select {
        -moz-appearance: none;
        text-indent: 0.01px;
        text-overflow: '';
    }
    

    Tested on Windows 8, Ubuntu and Mac, latest versions of Firefox.

    Live example: http://jsfiddle.net/joaocunha/RUEbp/1/

    More on the subject: https://gist.github.com/joaocunha/6273016

提交回复
热议问题