I have a bunch of containers containing radio buttons. The goal is for the container of a selected radio button to appear different:
input[type="radio"]:checked+.container {
border: 5px solid red;
}
<div class="container">
<input class="btn-radio" type="radio" value="123" name="rd" />
</div>
<div class="container">
<input class="btn-radio" type="radio" value="1234" name="rd" />
</div>
<div class="container">
<input class="btn-radio" type="radio" value="12345" name="rd" />
</div>
Why is it not functioning as expected?