Follow

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use
Contact

disabled select tag doesn't have the color specified in css on chrome

select:disabled {
  background-color: #BBBBBB;
}
<select disabled>
  <option>test</option>
</select>

If you run the code above on chrome and then check the background color of the select tag using a color picker you will get #CFCFCF and not #BBBBBB

Doing the same on a tag works as expected, is this a bug in chrome or am I missing something?

MEDevel.com: Open-source for Healthcare and Education

Collecting and validating open-source software for healthcare, education, enterprise, development, medical imaging, medical records, and digital pathology.

Visit Medevel

>Solution :

disabled changes the item’s opacity. add opacity: 1;

select:disabled {
  background: #BBBBBB;
  opacity: 1;
}
<select disabled>
  <option>test</option>
</select>
Add a comment

Leave a Reply

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use

Discover more from Dev solutions

Subscribe now to keep reading and get access to the full archive.

Continue reading