-1

I have the following link which will be rendered inside my breadcrumb navigation:-

<a class="breadcrumbNode" href="http://******/kb/CustomerKB/_layouts/15/listform.aspx?ListId=%7B9A25812B%2DE8BA%2D4085%2D95D0%2D9E05CF3DC441%7D&amp;PageType=0&amp;RootFolder=%2Fkb%2FCustomerKB">CustomerKB</a>

so is there a way using CSS to hide the link which have the following text CustomerKB ??

John John
  • 1
  • 72
  • 238
  • 501

2 Answers2

0

If you want to hide all elements containing specific text, you will have to use Javascript. The only way I can think of to do this with CSS is by adding another class to the links you want to hide, or wrapping the text in another tag and giving this tag specific classes depending on what's in it, and you do not seem to want to do that.

Any particular reason you do not want to use JS?

If you can use Javascript, I would simply do something like

document.getElementsByClassName("breadcrumbNode").forEach(function(item) {
    if (item.innerHTML === "whatevertext") {
        item.classList.add("hidden")
    }
});
Alex Eggers
  • 328
  • 3
  • 16
0

You can use the *= selector to select based on the link.

a[href*="CustomerKB"] {
    display:none
}

If you want to select based on the actual text contents of the anchor tag then you'd need to use something like jquery.

$("a:contains('CustomerKB')").hide();
abney317
  • 7,760
  • 6
  • 32
  • 56