Answer the question
In order to leave comments, you need to log in
How to style parent when input:checked?
The gist is this:
<div class="popup">
<table>
<tbody>
<tr>
<td style="width: 15%;"><h3>500</h3><input type="checkbox" checked="checked" onchange="calc()"
value="500" id="key2"></td>
<td><strong>Выделить анкету</strong>выделите вашу анкету среди прочих
(в 3 раза больше просмотров)</td>
</tr>
</tbody>
</table>
</div>
.popup table{border-bottom: 10px solid #FFB2B2;}
input[type=checkbox]:checked
Answer the question
In order to leave comments, you need to log in
CSS can't do that. If you are interested in the JS version:
document.querySelector("input[type=checkbox]").onchange = function(){
document.querySelector("table").classList.toggle("check", this.checked);
}
.check{
border-bottom: 10px solid #FFB2B2;
}
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question