Kevin Powell - CommunityKP-C
Kevin Powell - Communityβ€’2y agoβ€’
17 replies
TheJoshShephard

Pseudo Selector Solution?

I feel silly for asking this, but I'm currently trying to target something on a social site that allows custom code. I've been able to figure most things out.
But I'm currently struggling to find a possible solution.

On the site, in one section the header has words wrapped around a link.

If I use ::before, the whole thing changes. If I use :not() I can't exclude the href present.
Thought maybe I'm using it wrong with this current attempt.

The html essentially looks like such...
<div class="divname">
<h4>"word are here[" == $0
<a href="link">link title</a>
"]"
</h4>
<p></p>
</div>

Is there a way to target just the sentence before the link or way to exclude the link? I want to change the before and essentially keep the link and the after if possible

Quick edit: The site does not allow for Java, so I'm limited to pure CSS.
Was this page helpful?