How to hide drop down arrow in IE8 & IE9?

后端 未结 5 1270
小蘑菇
小蘑菇 2020-11-28 07:50

I used the CSS below to hide the drop down arrow in FF, safari, chrome and added my own image to customize.

select 
{
  -webkit-appearance:none;
  -moz-appea         


        
5条回答
  •  栀梦
    栀梦 (楼主)
    2020-11-28 08:38

    You cannot remove the arrow in pure CSS for IE9 < That's why they made ::-ms-expand for IE10.

    You could, however, do something like this. jsFiddle here

    In this example, you set a fixed width on select, and wrap a div with a lower width and overflow:hidden in order to mask/hide the dropdown. It has full support. This essentially does hide the arrow in all browsers.

    CSS

    div {
        width: 80px;
        overflow: hidden;
        border: 1px solid black;
    }
    select {
        width: 100px;
        border: 0px;
    }
    

提交回复
热议问题