I have this structure generated by WordPress plugin:
<span>
<input/>
</span>
<label></label>
I need to write my css like this:
input:focus+label {
color: #1743fc;
transform: translateY(1rem) translateX(0.5rem);
}
But the "+" and "~" rules don’t work. How can i do this?
>Solution :
You can use :has() now in some browsers:
span:has(input:focus) + label {
color: #1743fc;
transform: translateY(1rem) translateX(0.5rem);
}