Jump to content

Help change the color of my drop-down when selected

Recommended Posts

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 {
height: 40px;
padding: 4px 0px 0px 2px;
margin: 0px;
background: #ffffff;


Share this post

Link to post
Share on other sites

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.

Share this post

Link to post
Share on other sites

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.

Share this post

Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.