<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?
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>
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With