I have a requirement in my project to give a particular type of styling to the default i.e. placeholder value of a select tag when the select is "disabled". I am aware that it can be given using select:invalid but I find it working only when select is "required" and but I want a solution for the below scenario.
<select disabled>
<option disabled value="" selected>- please choose -</option>
<option value="1">Apple</option>
<option value="2">Banana</option>
</select>
Note: The requirement I have to resolve is in the select box the placeholder option i.e. the disabled option "-please choose-" has to be in italics and the rest of the options have to be in normal font style. Even when the select box is expanded. so you see in the "required state" I am able to give them different styles using :invalid selector(which doesn't works when the select is in "disabled state"), but in the disabled state, I am able to give just one type i..e italics or normal, if an option is selected and the select box is disabled/made non-editable following some condition, the option is looking like it is a placeholder because of the italics style.