Search code examples
htmlcssselectselectorhtml-select

Is there a way to select an open select box in css?


I set a background image (arrow down) to a select box after setting the webkit-appearance attribute to none. When the option list is opened I want to display another background image (arrow up). Is there a pseudo class or something for it? I couldn't find anything during my research...


Solution

  • It's not possible to detect if a HTML select element is opened using CSS, or even javascript.

    If you wish to customise the arrow symbol of a custom dropdown, your best option is to use a custom dropdown component which maps to a hidden select element.