Title: Multiple CSS selector
Tags: html;css;radio-button
Question: I am trying to create a CSS style to an element based on radio button check status. The following is the HTML code.
<div&gt;
<input class="assaf" id="radio3" type="radio" name="radio" value="3" /&gt;
</div&gt;
<label for="radio3"&gt;
<span&gt;<span&gt;
</span&gt;</span&gt;
Option 3
</label&gt;
The problem is, I can NOT write a CSS style so label and its children style are set based on radio button status (checked or not).
Removing the first div, I can do something like this which works fine.
input.assaf[type=radio]:not(old):checked}  + label &gt; span &gt; span
But, I have a case that must have this div, I tried something like the following but it does not work!!
div &gt; input.assaf[type=radio]:not(old):checked}  + label &gt; span &gt; span
Any idea?
Comment: Cannot do it based on your html

Here is the accepted answer: No. It doesn't work.
You cannot select the parent element from child element and then reach its sibling in css.
Instead, you can place the label element inside the div and use:
input.assaf[type=radio]:not(old):checked}  + label &gt; span &gt; span
the same as you mentioned.
If you necessarily need the div around the radio input. I would like to know why?
Comment for this answer: you can style it with `:before` and `:after` pseudo selectors on the `input`.
Comment for this answer: I would like to edit the style of existing radio buttons written in dojo. The system is huge and very complicated, so I am looking for a minimal change to do(CSS is recommended).


{'source': 'StackExchangeDataset', 'subset': 'stackoverflow.com', 'metadata': {'AnswerCount': 1, 'CommentCount': 1, 'ContentLicense': 'CC BY-SA 3.0', 'CreationDate': '2018:00:02/21/18', 'FavoriteCount': 1.0, 'PostTypeId': 1, 'Tags': '<html><css><radio-button>', 'Title': 'Multiple CSS selector', 'ViewCount': 46, 'id': 48911667, 'user_AboutMe': None, 'user_AccountId': 11542042.0, 'user_DisplayName': 'Mustafa Assaf', 'user_Reputation': 3.0, 'user_Views': 2.0, 'user_id': 8457364.0}}