Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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

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 and Safari, but not in Mozilla and IE.

select.desktopDropDown {     appearance: none;     -moz-appearance:none; /* Firefox */     -webkit-appearance:none; /* Safari and Chrome */ } 

Here is a [jsfiddle][1].

like image 254
Anton Belev Avatar asked Aug 26 '13 08:08

Anton Belev


People also ask

What does the abbreviation ie mean?

Hint: The abbreviation i.e. is short for the Latin phrase id est, meaning "that is." -ie. noun suffix.

Is it correct to use IE?

Only use these abbreviated forms e.g. and i.e. in more informal or expedient documents. It is always correct to simply write out, "for example," or "that is." Since these are abbreviations, they do require a period after each letter.

How do you use IE in a sentence?

The abbreviation "i.e." should always appear after the first section of the sentence, in the middle, so it is grammatically correct. For example, the sentence, "I.e. he likes super heroes" or the sentence, "He likes super heroes, i.e." are incorrect.


2 Answers

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 .

like image 184
AhmedBinNasser Avatar answered Nov 11 '22 09:11

AhmedBinNasser


Bare-bones examples:

For I.E:

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

For Firefox:

select {     -moz-appearance: none;     appearance: none;      text-overflow: ''; /* this is important! */ } 
like image 28
Jarrod Avatar answered Nov 11 '22 08:11

Jarrod