Styling the 'selected' option in drop down menu's

In this board you can talk about general questions about phpMyFAQ

Moderator: Thorsten

Post Reply
rogierl
Posts: 9
Joined: Wed Sep 03, 2014 4:25 pm

Styling the 'selected' option in drop down menu's

Post by rogierl »

When adding a question in the admin section, there are drop down menu's, for category for instance. The option that is selected has a bright blue background color. I like to change this.
Problem is that it has no class or id so it cannot be targeted by the style.css. I guess it's done in a javascript file somewhere.

Does anyone know how to change this color? Thanks in advance.
Thorsten
Posts: 15724
Joined: Tue Sep 25, 2001 11:14 am
Location: #phpmyfaq
Contact:

Re: Styling the 'selected' option in drop down menu's

Post by Thorsten »

Hi,

I could add a css class if you like, just tell me for which drop down.

bye
Thorsten
phpMyFAQ Maintainer and Lead Developer
amazon.de Wishlist
rogierl
Posts: 9
Joined: Wed Sep 03, 2014 4:25 pm

Re: Styling the 'selected' option in drop down menu's

Post by rogierl »

I'm not sure actually if adding a class will help. I am talking about the 'Categories'-dropdown in the page in the admin-section where you add a new question. It's a 'select'-element and it already has an id, named 'phpmyfaq-categories'.
Everything in the list is an 'option' and the selected option get's a bright blue background color. I don't know how to target this selected option.

Do you know how to do this?
Thorsten
Posts: 15724
Joined: Tue Sep 25, 2001 11:14 am
Location: #phpmyfaq
Contact:

Re: Styling the 'selected' option in drop down menu's

Post by Thorsten »

Hi,

Code: Select all

option:checked {
  color: red;
}
should work.

bye
Thorsten
phpMyFAQ Maintainer and Lead Developer
amazon.de Wishlist
rogierl
Posts: 9
Joined: Wed Sep 03, 2014 4:25 pm

Re: Styling the 'selected' option in drop down menu's

Post by rogierl »

Hi Thorsten,

I tried it: option:checked and option:selected, but it doesn't work.
Thorsten
Posts: 15724
Joined: Tue Sep 25, 2001 11:14 am
Location: #phpmyfaq
Contact:

Re: Styling the 'selected' option in drop down menu's

Post by Thorsten »

Hi,

which browser did you used?

bye
Thorsten
phpMyFAQ Maintainer and Lead Developer
amazon.de Wishlist
Post Reply