I have that HTML:
<span class="label-text"></span><ul id="id_stars">
<li><label for="id_stars_0"><input class="star-field" id="id_stars_0" name="stars" type="radio" value="1" /> 1</label></li>
<li><label for="id_stars_1"><input class="star-field" id="id_stars_1" name="stars" type="radio" value="2" /> 2</label></li>
<li><label for="id_stars_2"><input class="star-field" id="id_stars_2" name="stars" type="radio" value="3" /> 3</label></li>
<li><label for="id_stars_3"><input class="star-field" id="id_stars_3" name="stars" type="radio" value="4" /> 4</label></li>
<li><label for="id_stars_4"><input class="star-field" id="id_stars_4" name="stars" type="radio" value="5" /> 5</label></li>
</ul>
And I have that CSS:
#id_stars{
list-style: none;
}
#id_stars label{
font-weight: normal;
}
#id_stars input[type=radio]{
display: none;
}
#id_stars label{
width: 15px;
height: 15px;
margin: 0 0 0 5px;
cursor: pointer;
border: 0px;
border-radius: 2px;
background-color: #C1C1C1;
}
input[type=radio]:checked + label{
background: #F79414;
}
When the radio field is cheked, the color of the label is not changing.
Any idea?
Bonus question: How could I do custom a custom radio button near the label without touching the HTML code (generated by Django forms), instead of modifying the label like now?
#id_stars input[type=radio]:checked + label