Answer the question
In order to leave comments, you need to log in
How to fill the background of the block if the checkbox is selected?
Hello! We have the following structure:
<div class="row">
<div class="col-md-3">
<div class="hideRadio">
<img src="http://i013.radikal.ru/1606/23/77673ff2a869.png">
<input type="radio" ng-model="typemat" value="bal1">
<p>Балкон1</p>
</div>
</div>
<div class="col-md-3">
<div class="hideRadio">
<img src="http://i013.radikal.ru/1606/23/77673ff2a869.png">
<input type="radio" ng-model="typemat" value="bal2">
<p>Балкон2 </p>
</div>
</div>
</div>
input[type=radio]:checked + p {
color: #000;
font-weight: bold;
}
Answer the question
In order to leave comments, you need to log in
В CSS нет селектора родителя/предка. См. stackoverflow.com/questions/1014861/is-there-a-css...
Только через JavaScript.
Можно, например, на <div class="hideRadio">
добавить:
<div class="hideRadio"
ng-class="{'is-active': typemat === 'bal1'}"> <-- проверка на значение модели нужного радиобаттона.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question