Change The 'option' Color With The Attribute 'disabled'
Answer :
It can't be both selected and disabled.
option:disabled { color: red; }
<select> <option selected>Choose something</option> <option disabled>1</option> <option>2</option> <option>3</option> </select>
If you want to disable the select, instead of the option you need to moved disabled to the select tag
select:disabled { color: red; }
<select disabled> <option selected>Choose something</option> <option>1</option> <option>2</option> <option>3</option> </select>
Try this:
CSS:
select{ color:red; } option{ color:black; }
try this, hope it will work: in html:
<select> <option value="">Choose something</option> <option disabled="disabled" value="" class="red">1</option> <option disabled="disabled" value="" class="red">2</option> <option disabled="disabled" value="" class="red">3</option> </select>
in CSS:
select :disabled.red{ color: red; }
Comments
Post a Comment