1👍
For the second style you need to use nth-of-type
. But as CSS only it works:
select option[value="chair"] {
background-color: red;
}
select option:nth-of-type(3) {
background: green;
}
<select name="work" class="form-control" required="" id="id_work">
<option value="" selected="">---------</option>
<option value="chair">The chair</option>
<option value="table">The table</option>
</select>
👤Azu
- [Answered ]-Django model class method using wrong `self`
- [Answered ]-Serializing Related Data in Django using Natural Foregin Keys (Three Models, Two Layers)
- [Answered ]-Django: Using south on project with existing migration files
- [Answered ]-Django – Allow duplicate user's emails in the grand User model, but unique in its extended models?
- [Answered ]-Getting ID instead of Name in list
Source:stackexchange.com