Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Is it possible to Display None using href link? [duplicate]

Tags:

html

css

display

<a href="example.html">Any text or Image<a>

I wanted to add display none using the value of href.

Eg: I just want to add display: none to all anchor tags which redirect to example.html. All other anchor tags should be still visible.

In other words I just want to hide the links which go to example.html.

Is this possible?

like image 698
I am the Most Stupid Person Avatar asked Oct 19 '25 06:10

I am the Most Stupid Person


1 Answers

You can use the following solution, using a attribute selector:

a[href="example.html"] {
  display:none;
}
<a href="example.html">Any text or Image<a>
<a href="https://stackoverflow.com/">StackOverflow<a>

You can also use a[href$="example.html"] if the href contains the full url:

a[href$="example.html"] {
  display:none;
}
<a href="example.html">Any text or Image<a>
<a href="https://example.com/example.html">Any text or Image<a>
<a href="https://stackoverflow.com/">StackOverflow<a>
like image 105
Sebastian Brosch Avatar answered Oct 20 '25 21:10

Sebastian Brosch