Follow

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use
Contact

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

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?

MEDevel.com: Open-source for Healthcare and Education

Collecting and validating open-source software for healthcare, education, enterprise, development, medical imaging, medical records, and digital pathology.

Visit Medevel

>Solution :

Your css selector is incorrect.
Use this code.

label.radio input:checked + span i {
     color: #3578fa !important;
}
Add a comment

Leave a Reply

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use

Discover more from Dev solutions

Subscribe now to keep reading and get access to the full archive.

Continue reading