IE & Firefox - custom drop down could not remove native arrows

前端 未结 5 2268
清酒与你
清酒与你 2020-12-13 09:40

I\'m trying create a custom drop down control and I need to hide the arrows from the native controls. I\'m using the following CSS, which is working for Chrome

5条回答
  •  无人及你
    2020-12-13 10:23

    Use this it will work but with IE10+ and for FF :

    Your css should look like this:

    select.desktopDropDown::-ms-expand {
        display: none;
    }
    

    More about ::ms-expand.

    Then for the rest :

    select.desktopDropDown {
        outline : none;
        overflow : hidden;
        text-indent : 0.01px;
        text-overflow : '';
        background : url("../img/assets/arrow.png") no-repeat right #666;
    
        -webkit-appearance: none;
           -moz-appearance: none;
            -ms-appearance: none;
             -o-appearance: none;
                appearance: none;
    }
    

    Note: I hardcoded path "../img/assets/arrow.png" as background.

    This should work good for you in IE, Firefox and Opera .

提交回复
热议问题