Hello,

There are markup

<label class='radioConainer'><input type='radio' name='name' value='1' checked></label> <label class='radioConainer'><input type='radio' name='name' value='2'></label> <label class='radioConainer'><input type='radio' name='name' value='3'></label> 

CSS:

 .radioContainer { border: 1px solid #258eff; display: block; padding: 10px; border-radius: 3px; } 

How, depending on the: checked property, do I change the frame color of the parent label without using JS?

  • There are selectors who, say, make the next element standing next to some other, for example, input: checked + label or all subsequent input: checked ~ label, but to the previous ones or parents, in my opinion, there is no such thing yet. - binliz
  • @undestroyer, wait for css4, there will be such a selector. @ soledar10, a strange answer, which is completely irrelevant to the question - MasterAlex
  • @MasterAlex where did you get this info about CSS4? As far as I know, such selectors will not be implemented - inferusvv
  • @MasterAlex did not understand the question - soledar10

2 answers 2

At the moment, using CSS can not "reach" the parent element relative to the current

    Here the answer is why access up to CSS is impossible.
    This is a draft version of CSS fourth version, there is access to the parent.
    True, he is supposed to be slow for the time being, but with the release of the beta, this will surely be fixed.