I have different anchor tags with href=#ids and I need to hide them using a general css rule for all of them,
Content xxxxxxxxx <a href="#tab1">Table 1</a>.Content xxxxxxxxxxxx <a href="#tab2">Table 2</a>
I was trying to use something like this:
#wrap a='#tab1'{
display:none;
}
Any idea how to do it?
Use CSS styling to make your links invisible The first way is by using none as the pointer-events CSS property value. The other is by simply coloring the text to match the background of the page.
To prevent an anchor from visiting the specified href, you can call the Event interface's preventDefault() method on the anchor's click handle.
In order to disable a HTML Anchor Link (HyperLink), the value of its HREF attribute is copied to the REL attribute and the value of HREF attribute is set to an empty JavaScript function. This makes the HTML Anchor Link (HyperLink) disabled i.e. non-clickable.
#wrap a[href="#tab1"]{
display:none;
}
Why not just create a CSS class for your anchors and hide them using that class?
<a href="#tab1" class="hiddenTab">foo</a>
And in your CSS:
a.hiddenTab {visibility:hidden; display:none;}
All the anchors you'd want to hide would just use "class='hiddenTab'"
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