I have a select-Element with 4 options like this:
<select name="selectname">
<option value="V1" disabled selected hidden>Text1</option>
<option value="V2">Text2</option>
<option value="V3">Text3</option>
<option value="V4">Text4</option>
</select>
I want the textcolor of the selected option the be displayed in gray (in the select-box, to let it look like a placeholder). For this i use the following css:
<style>
select:disabled {color: gray; }
</style>
But the textcolor of the selected option is displayed in black (standardcolor).
I tried using different attributes in my css instead but this doesn't work as well.
select:selected {color: gray; }
select:hidden {color: gray; }
select:invalid {color: gray; }
And i have tried using a different keyword:
select:disabled {textcolor: gray; }