Why is ~ not working in case of .icon class ? | SoloLearn: Learn to code for FREE!

0

Why is ~ not working in case of .icon class ?

input[type="checkbox"]:checked ~ i{ color:#9f9; } input[type="checkbox"]:checked ~ .icon{ box-shadow: inset 2px 2px 3px grey ; } It the above code , the '~' is working perfectly in case of i tag but not working in class = "icon" ?? Why ?

css

2/1/2020 4:48:03 AM

ABHISHEK

4 Answers

New Answer

+3

Can you write full code on Sololearn Playground and share here. Maybe you did something mistake.

+3

ABHISHEK I found that ~ works on next tag or class or id. But your class is before the checkbox That's Why it's not working. Check this code edited by me Just check the last icons and click on that. https://code.sololearn.com/WqGn9jJSbylr/?ref=app

+1

🅰🅹 - Sʀ. Sᴏғᴛᴡᴀʀᴇ Eɴɢɪɴᴇᴇʀ Wow Thanks a lot❤️😊

0

🅰🅹 - Sʀ. Sᴏғᴛᴡᴀʀᴇ Eɴɢɪɴᴇᴇʀ Here it is https://code.sololearn.com/WymAJiwNYugo/?ref=app