At the moment with the help of css it can not be done, but in the future the pseudo-class will be available : has () , which you can use according to the idea:
select:has(> .red:checked) { background: red; }
Which means, if the select element is the parent of the selected element with the red class (in your case option), then we describe the styles for it.
https://drafts.csswg.org/selectors-4/#relational
Using jquery, you can do it like this:
$('.select').change(function() { var selectedColor = $('.select option:selected').val(); $('.select').css('background', selectedColor); });
<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script> <select class="select"> <option selected="selected" value="--">--</option> <option value="red">red</option> <option value="green">green</option> <option value="blue">blue</option> <option value="grey">grey</option> </select>