Home > Blockchain >  If radio input is checked change color of an element not working
If radio input is checked change color of an element not working

Time:11-23

I have the following HTML code:

<label class="radio">
<input type="radio" name="plan" value="plan" required>
<span>
<h6>Plan</h6>
<i class="pe-7s-graph1 plan-icon my-3"></i>
<h6 class="pricing-card-title text-success">PRICE<small class="text-muted fw-light">/monthly</small></h6>
<p>Lorem Ipsum is simply dummy text of...</p>
</span>
</label>

and the following css:

label.radio input:checked   label.radio i {
     color: #3578fa !important;
}

but it is absolutely not working. Any idea why?

CodePudding user response:

Your css selector is incorrect.
Use this code.

label.radio input:checked   span i {
     color: #3578fa !important;
}
  • Related