I want to change the color of the selected "option" of the "select" element, but when I use the "color" attribute, it applies to the entire list of "option" and not just the selected one, while if I use the "font-weight", it only applies to the selected "option" and not the entire list of "options". So, why is that? And how do I change the color of only the "option" that is being selected and appears in the "select" element?
select option:checked {
color: red;
}
select {
font-weight: bold;
color: blue;
}
<select>
<option>Something 1</option>
<option>Something 2</option>
<option>Something 3</option>
<option>Something 4</option>
<option>Something 5</option>
<option>Something 6</option>
<option>Something 7</option>
<option>Something 8</option>
<option>Something 9</option>
</select>
As you can see, I tried using the pseudo-class "checked", but what this does is to make the selected "option" different color, but only inside the list of "options", and not when it appears on the "select" element.
The "font-weight:bold" applies only to the selected "option", but as you can see, the "color" applies to the entire list.