Currently I have a tweaked radio button coded :
<label>
<input type="radio" ... />
<span>...</span>
</label>
And some CSS applying to the first element following the input once checked like :
input:checked + span {
...
}
It works perfectly well: when the label is clicked, the input gets in checked state and the CSS does apply to the span element (change of text color ..)
Though now I add an image just before the span :
<label>
<input type="radio" ... />
<img ... />
<span>...</span>
</label>
with similar CSS added on top of previous :
input:checked + img {
...
}
Now what happens is : the image is applied the right CSS when the image is clicked. Though the span is no longer changed now. I don't understand what gets in the way. +
is still relevant as in both cases span
and img
are the direct following elements (of their type)