0

Is it possible to update first child after input[type=checkbox]:checked status in CSS3, without involving jQuery?

My question is about this technique in my DEMO:

input[type=checkbox]:checked ~ .useraccounts,
input[type=checkbox]:checked ~ .hashtags {
    background-color: #fd2626; // red color
}
David says reinstate Monica
  • 230,743
  • 47
  • 350
  • 385
  • @Paulie_D I disagree. There are some things you can do to change the content. You can hide certain elements or you can make use of the `content` rule in a `:before` or `:after` style or change just normal styles of course. The thing is that we need to know what the OP needs to change. – Joseph Marikle Jan 21 '15 at 15:36
  • You can't select **previous** elements with CSS which seems to be the requirement here. – Paulie_D Jan 21 '15 at 15:36
  • You can, however, select elements that come **after**, like the OP mentioned. – Joseph Marikle Jan 21 '15 at 15:39
  • Pending clarification from the OP I'm voting to close as a duplicate (of the same question nominated by Paulie_D); since there's no element following the checkbox elements that have any element-children. – David says reinstate Monica Jan 21 '15 at 15:52