Hi there! I am on the hunt for a CSS selector that will target all anchor links that are not empty and contain content.
I currently have a selector to identify all links with an anchor attribute, like in this example:
a[href*=\#] {
background-color:#f00;
}
<div id="sample">
<p>
Hello, yesterday I walked about 50
<a href="http://www.example.com">example</a>
kilometers down a shiny road.
After seeing my friends <a href="#friends">smoking</a> a
<a href="#">shiny cigarette</a>, the air became dark
<a href="http://example.com/#">and</a>
my fancy mood
<a href="http://www.example.com/#inc">increased</a>.
</p>
</div>
However, what I really need is a way to select only anchors with href="#something", and exclude those with href="whatever#"
.
This means that "shiny cigarette" and "and" should not be included in the selection.
Can you offer any assistance with this? Your help would be greatly appreciated!