Datatables Editor - Custom color for select placeholder (value empty '')
Datatables Editor - Custom color for select placeholder (value empty '')
I would like to style the placeholder of a select (default value empty '') (https://editor.datatables.net/examples/simple/fieldTypes.html) a bit different than when a value is selected.
I've tried so far:
CSS:
.DTE_Field_InputControl select::placeholder {
color: #999;
}
/*
.DTE_Field select::placeholder {
color: #999;
}
*/
/*
.DTE_Field select[placeholder="Select"] {
color: #999
}
*/
/*
.DTE_Field select option:disabled {
color: #999
}
*/
HTML:
<select id="DTE_Field_groups-status" class="form-control">
<option value="" hidden="" disabled="">Select</option>
<option value="0">Inactive</option>
<option value="1">Active</option>
</select>
Any idea how to accomplish this?
This discussion has been closed.
Answers
I'm not sure that is possible with CSS I'm sorry to say. The
select
element can be really hard to style - the browser's are quite limited in what they can do with it, and assigning a specific colour to a specificoption
is one of the limitation I think.Allan