I use input:not(:placeholder-shown)
to determine if a value is in an input field.
Is there some CSS way to check if an <option />
has been selected in a <select>
element?
I want to style the label tag immediately following the select dropdown IF an option has been selected.
Here is an example:
<select class="form-control">
<option></option>
<option value="1">One</option>
</select>
<label>Pick One</label>
Here is the CSS that I want to use to manipulate if an option (with a value) has been selected.
select.form-control:checked ~ label{
color: red;
}