What is CSS?
CSS is called Cascading Stylesheet which is used for giving the style into the HTML Pages. If html is laptop, CSS is the BackPack.
What is HTML?
HTML is called Hyper Text Markup Languages which is used for creating web pages by the method of tagging the texts to achieve font, color, links, etc. to form a web page.
What is Anchor Tag?
Anchor Tag, <a> tag define the hyperlink which is used for linking one website from another website.
Href is an attribute of the anchor tag which is also used to identify the sections with a document. A part from href there are so many different attributes that can be used within <a> tag for various purposes.
The anatomy of <a> tag is below
In this you can see that in the tag <a>, href is indicating that the link will go to https://www.techsvibes.com when the text “TV” will be clicked.
When you insert this code in a HTML Page, the output will show only the text “TV” which if you click on site link then site will be appear infront on your desktop screen.
If Text is hyperlinked then it is called anchor text and this is the text used for Anchor tag code. As we show in this example “TV” is the Anchor Text.
<a> tag is supported by almost all web browsers.
How To Disable Anchor Tag in HTML?
If you want to disable Anchor Tag in HTML, Here is the simple code , but it is not working in present days browsers. It is only work in Internet Explorer.
<a href=”https://www.techsvibes.com”disabled= “disabled”>TV</a>
How To Disable Anchor Tag in HTML pages using CSS.
CSS is used for grace you HTML web pages, and this is the reason of styling the web pages. Moreover, CSS can do many more.
As well as CSS can use for disabling Anchor Text.
For This, You can just use Pointer-events style, and it will be done.
I am writing an inline CSS code for the same.
Within the Anchor Tag I have added within “style” is the CSS code. When you add this code , the link from the text will be disabled and the text will become not clickable.
<a href=”https://techtricksworld.com/” onclick =”return false;” >TV</a>
Hence, You done this, you can now see the link on the text but, when you click on that link, if link will not open it means now link is disabled and no link in the text.