This is a weird behavior. I think this is because <p> are siblings of the input element, not children. I found a bit of hacking as a job. You just surround each input and p block in the div . Then use the selector ~ ...
css:
input:checked ~ p + p { color: red; }
html:
<div> <input type="radio" name="accordion" checked /> <p>Paragraph one</p> <p>Paragraph two</p> </div> <div> <input type="radio" name="accordion" /> <p>Paragraph three</p> <p>Paragraph four</p> </div>
demo:
http://codepen.io/lukeocom/pen/CABes
UPDATE:
I just noticed adding this css to my original html and it works too. I'm not sure why, though, since the second selector style is empty ...
input:checked + p + p { color: red; } p:nth-child(2){}
source share