Pseudo-elements cannot be targeted by sibling combinators because sibling combinators only represent element siblings, not pseudo-element siblings.
So, although the boxes generated by ::before
and ::after
are siblings of one another in terms of layout, for the purposes of sibling combinators they are not.
It is not possible to write a selector styling an element's ::before
pseudo-element when its ::after
pseudo-element is hovered. (For that matter, ::after:hover
is not valid outside of Selectors 4 either, and no implementations exist.) There are hacks that make use of things like pointer-events
but there is nothing that is guaranteed to work on all browsers.