Hide default component [arrow] form select in IE

Asked

Viewed 2,121 times

10

I got a problem here at IE.

I am styling the select component of the form, hiding the arrow that comes by default from the browser to load an image in its place.

In FF and Chrome was quiet, but in IE is appearing the default arrow of the browser, I gave a search and tests on all possible variants of the same but said whose continues to appear, even using:

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

Code:

form select{
    background: transparent;
    border: 1px solid #DDDDDD;
    border-radius: 5px 0 0 5px;
    box-shadow: 1px 0 2px rgba(0, 0, 0, 0.2) inset;
    color: #999; 
    font-size: 14px;
    height: 45px;  
    padding: 0 5px;
    width: 250px;
    -webkit-appearance: none;
    -moz-appearance: none;
    -ms-appearance: none;
    -o-appearance: none; 
    background: url("http://www.iconesbr.net/iconesbr/2009/06/8383/8383_32x32.png") 100% / 17% no-repeat;
    text-transform: uppercase;
    select::-ms-expand { display: none; }/* Remove seta padrão do IE*/ 
    
}

select::-ms-expand {
  display: none;
}
<form method="post" action="">
        <label>
            <select name="depto" id="selectDepto">
              <option selected value=""> Busca por departamento</option>
              <option value="administração">Administração</option>
              <option value="comercial">Comercial</option>
              <option value="consultoria">Consultoria</option>
              <option value="controle de qualidade">Qualidade</option>
              <option value="desenvolvimento">Desenvolvimento</option>
              <option value="diretoria">Diretoria</option>
              <option value="endomarketing">EndoMarketing</option>
              <option value="financeiro">Financeiro</option>
              <option value="implantação">Implantação</option>
              <option value="marketing">Marketing</option>
              <option value="pré implantação">Pré-Implantação</option>
              <option value="recursos humanos">Recursos Humanos</option>
              <option value="tecnologia">Tecnologia</option>
              <option value="treinamento">Treinamento</option>                  
            </select>
       </label>
</form>           

How can I fix this?

Jsfiddle

  • I tested on 11 and did not show the arrow, the image ended up "hiding". Anyway, related: http://answall.com/q/46034/4808

  • There is a gambit that can be made with overflow-hidden. Only I don’t remember now :(

  • Related question in SOEN. http://stackoverflow.com/questions/20163079/remove-select-arrow-on-ie

  • @Renan was testing on IE10 with this was the image of the blue arrow I want to display in select behind the default IE arrow. =/

  • @Kor saw the link of the question I posted? Any of the solutions help?

  • I think it was solved with the updates of IE, because I am in your fiddle and does not appear the arrow for me (version 11.0.9600.18617)

Show 1 more comment

1 answer

1

Do it this way, it works in the latest versions of the browsers (IE from version 10):

.estilizar select {
    border: 0 !important;
    -webkit-appearance: none;
    -moz-appearance: none;
    background: #fff url("https://cdn4.iconfinder.com/data/icons/cc_mono_icon_set/blacks/16x16/br_down.png") no-repeat scroll 88% center;
    background-position: 98% center;
    width:35%;
    height:35px;
    text-indent:0.01px;
    text-overflow:"";
}

select::-ms-expand {display: none;}
<div class="estilizar">
   <select class="local">
     <option>Qual cidade irá visitar?</option>
     <option>Buenos Aires, Argentina</option>
   </select>
</div>

  • When you say "any browser", what exactly do you mean? As far as I know on IE9, it doesn’t work.

  • From IE 10 it works, the correct is not to support old versions of IE, microsoft no longer gives more (https://www.microsoft.com/pt-br/windowsforbusiness/end-of-ie-support). For the internet to evolve, we must innovate, ever heard of Graceful Degradation? For those who innovate using modern browsers will see the novelties, for those who do not have to settle for what the browser supports.

  • 1

    It doesn’t matter, what I’m talking about is your text, people don’t understand about end support often, let alone the end user. In any browser is to force a little ... [a pause ....... remember this is a constructive criticism] .................. The text would be more interesting if it stood out something like, works on IE10+, Firefox and Chrome

  • I agree with you William, I understand your criticism as constructive, I am only explaining to those interested to read this comment, the reason why we should contribute to the evolution of the internet. I will insert in my reply the IE version that this suggestion meets.

Browser other questions tagged

You are not signed in. Login or sign up in order to post.