I want to target a pseudoclass (::before) using an adjacent sibling selector with CSS. The node-bullet:before
needs to be targeted using has-color
as a reference.
Below is code, I wrote the pseudoclasses ::before
and ::after
to mimic what I see when I inspect html/css on the code I'm working with.
.Node-bullet:before + .has-color {
background-color: green;
}
<div class="foo1">
<div class="Node-bullet">
::before
<p> Pseudoclass ::before needs to be targeted </p>
::after
</div>
<div class="has-color">
<p> Use .has-color class to target ::before class </p>
</div>
</div>