imgrooot Posted May 5, 2019 Share Posted May 5, 2019 I want to change the color of an option that's disabled. By default it's showing grey. <option disabled="true" class="disabled">Heading One</option> I tried using the "disabled" class to change the color but it doesn't work. But for some reason I can change it's size. Is there a way around this that would work in all browsers? Quote Link to comment https://forums.phpfreaks.com/topic/308672-is-there-a-way-to-add-a-different-color-for-the-select-disabled-option/ Share on other sites More sharing options...
imgrooot Posted May 5, 2019 Author Share Posted May 5, 2019 Never mind. I was able to do it using this method. option:disabled { color: red; } Quote Link to comment https://forums.phpfreaks.com/topic/308672-is-there-a-way-to-add-a-different-color-for-the-select-disabled-option/#findComment-1566469 Share on other sites More sharing options...
imgrooot Posted May 5, 2019 Author Share Posted May 5, 2019 I should also mention that I was trying to make the grayed out disabled text into black color. Which is why it wasn't working for me. Seems like I can color the text any other color except black. Quote Link to comment https://forums.phpfreaks.com/topic/308672-is-there-a-way-to-add-a-different-color-for-the-select-disabled-option/#findComment-1566470 Share on other sites More sharing options...
kicken Posted May 5, 2019 Share Posted May 5, 2019 You can make it a color that's really close to black. For example, rgb(0,0,1); A person wouldn't be able to tell the difference. It's not rgb(0,0,0) though so the browser doesn't change it to the normal disabled gray. Quote Link to comment https://forums.phpfreaks.com/topic/308672-is-there-a-way-to-add-a-different-color-for-the-select-disabled-option/#findComment-1566472 Share on other sites More sharing options...
imgrooot Posted May 6, 2019 Author Share Posted May 6, 2019 18 hours ago, kicken said: You can make it a color that's really close to black. For example, rgb(0,0,1); A person wouldn't be able to tell the difference. It's not rgb(0,0,0) though so the browser doesn't change it to the normal disabled gray. That's good to know. Quote Link to comment https://forums.phpfreaks.com/topic/308672-is-there-a-way-to-add-a-different-color-for-the-select-disabled-option/#findComment-1566481 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.