Chrisj Posted September 10, 2015 Share Posted September 10, 2015 I've looked around the php script that I'm using and I can't figure out why my drop-down box border and background is blue when selected (see attached image). Can you help me with a suggestion on how to over-ride wherever that blue is? The css code I'm using to style the drop-down box is: input.common-input, select.dropdown_box { width:112px; height: 40px; padding: 4px 0px 0px 2px; margin: 0px; color:#cccccc; background: #ffffff; } Quote Link to comment https://forums.phpfreaks.com/topic/298123-help-change-the-color-of-my-drop-down-when-selected/ Share on other sites More sharing options...
cyberRobot Posted September 11, 2015 Share Posted September 11, 2015 The blue background comes from the browser showing which option is selected. To be honest, I'm not sure how you would override the color. I would imagine that it involves using JavaScript to detect which <option> tag is selected. Then applying a background color to that tag and remove the color from the other <option> tags. Quote Link to comment https://forums.phpfreaks.com/topic/298123-help-change-the-color-of-my-drop-down-when-selected/#findComment-1520659 Share on other sites More sharing options...
scootstah Posted September 11, 2015 Share Posted September 11, 2015 You have very little control over styling select boxes. You can change all of the option backgrounds, but you can't change the selected one or the hover color. You will have to use a Javascript replacement, such as Select2. Quote Link to comment https://forums.phpfreaks.com/topic/298123-help-change-the-color-of-my-drop-down-when-selected/#findComment-1520667 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.