Bramus · @bramus
1690 followers · 669 posts · Server front-end.social

@joachim [href=""]:has(~ :target)

#id1

Last updated 1 year ago

Joachim · @joachim
2109 followers · 17395 posts · Server boitam.eu

CSS question:
Is there a selector (or a combination or selectors) to target the <a> pointing to the element targeted by the current URL?

Let's say I have

<a href="">link 1</a>
<a href="">link 2</a>
<h1 id="id1">hello world</h1>

If I click the link, I know that I can now target the h1 with the `:target` pseudo-class. But can I target the link itself?

#id2 #id1

Last updated 1 year ago

Chiefbrody · @chiefbrody
0 followers · 2 posts · Server ricorda.social

Bananarama - Cruel Summer
.2BLXF992P8

#id1 #bananarama #cruelsummer

Last updated 2 years ago