snl
snl

Reputation: 1

How to override the default select option css?

In a form, I have two different dropdown menus (one required and one not required).

The required dropdown select has lightgrey placeholder text color whereas the regular dropdown select has black placeholder text color.

I want to override the black placeholder color to match the lightgrey. I cannot seem to override it with !important in CSS

select option:disabled {
   color: lighgrey !important;
}

This doesn't work and I'm not sure what works

Upvotes: 0

Views: 1429

Answers (1)

DCR
DCR

Reputation: 15657

place the color on select

select:disabled  {
   color: lightgrey!important;
}
<select disabled>
<option>black</option>
<option>green</option>
</select>

Upvotes: 1

Related Questions