Is it possible to select parent :after pseudo class from child by using '+' selector.
HTML:
<div class="parent">
<span class="child">Child</div>
</div>
CSS:
.parent:after{
content: "";
display: inline-block;
height: 20px;
width: 20px;
background-color: blue;
}
.child + :after{ // targeting parent after
background-color: red;
}
EDIT: To explain what I wanted to achieve - basically, I wanted to change label:after styling when checkbox is checked.
HTML:
<label class="parent">
<!--label:before-->
Click me to check me
<input class="child">
<!--label:after-->
</label>