Created
October 3, 2024 08:20
-
-
Save diego-betto/a0a9b2e55d8c1434db5c43d55838fbad to your computer and use it in GitHub Desktop.
CSS: select with placeholder gray, options and selected values black
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<style> | |
select { | |
color: #747474; | |
&:has(option:checked:not(:disabled)) { | |
color: #2c2c2c; | |
} | |
} | |
option { | |
color: #2c2c2c; | |
} | |
</style> | |
<select> | |
<option value="" disabled selected>PLACEHOLDER</option> | |
<option>1</option> | |
<option>2</option> | |
<option>3</option> | |
</select> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment