Remove Select arrow on IE
To remove the Select arrow in IE, and to ensure your design stays consistent across different browsers, you want to use the CSS snippet below. The approach uses the ::-ms-expand
pseudo-element, which is specific to IE, in conjugation with the cross-browser appearance
property:
This CSS, applied directly to your select
element, removes the dropdown arrow across different browsers, with special attention to IE.
Dealing with pesky dropdown arrows
Cross-browser support: Level Up
To achieve a refined cross-browser experience, apart from hiding the default dropdown arrow, you would often replace it with a custom icon. To do this effectively, house your select
element in a div
wrapper:
In the context of icon fonts, the :before
pseudo-element enters as your styling superstar. Modifying its properties, you can even overlay a tailored icon over the detested native select arrow:
Aesthetic and Accessibility: A Balancing Act
Remember, wherever there are styles, there are states. Consider accessibility limitations and creative demands by styling not only the standard, but also :focus
and :disabled
pseudo-classes of the select
element:
This allows you to extend the aesthetic consistency across form elements, whilst still providing clear and considerate user-feedback on the usability of the select dropdown.
Throwing a lifeline to legacy IE users
Now, for IE9 and earlier versions, we hit a rock due to the non-existence of ::-ms-expand
. Here we summon JavaScript workarounds or conditional comments for extra special attention:
When built-in solutions are just not enough
Chosen.js - Your selectable sidekick
When looking for a richly decorated UI experience or dealing with complex needs, a robust solution like Chosen.js
may be the righteous path:
With Chosen.js
, you have a library that manages the finer complexities of select box customization. Offering advanced features like search and tagging, it ensures a uniformed display across different browsers.
DIY - Opt for a custom JavaScript plugin
For some, the unique appeal or the need for granular control of the select element might lead you to create a custom JavaScript plugin.
With your plugin, you control every interaction to the finest detail, from keypress handlers to option rendering. You have the power to bring your creative vision to life.
Was this article helpful?