internet explorer - CSS: Remove gray highlight on a default option in a select element -
this problem happens on ie, tested ie11.
in order hide placeholder in browser, except ie, display none job. ie solution lit bit more elaborated. idea make default option disabled, user can't click on placeholder.
so far good, here comes problem now:
this shadow + highlight in gray not desired.
how reproduce (please use ie...)
stack snippet:
.default-option { display: none; } select::-ms-value { background: none; color: #42413d; }
<select> <option disabled selected class='default-option'>select...</option> <option>hello</option> <option>world</option> </select>
*ps: remove blue highlight on selected option based on hint. refer css on fiddle well.
i'm not sure can done css, can try
example : jsfiddle
a little js
$(function() { $('select').change(function() { $('select option.default-option').remove(); }); });
Comments
Post a Comment