HTML stands for Hyper Text Markup Languages which is used to create web pages by tagging the texts to achieve font, color, links, etc. to form a web page.
If you want to learn HTML, click here.
CSS stands for cascading stylesheet which is used for giving the style to HTML pages. If HTML is the body, CSS is the clothing.
Anchor tag, i.e. <a> defines a hyperlink which is used to link from one webpage to another webpage.
Href is the most important attribute of Anchor tag which holds the destination link. Apart 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://techtricksworld.com when the text “TTW” will be clicked.
When you put this code in an HTML page, the output will show only the text “TTW” which if you click will open the site.
Text which is hyperlinked is called Anchor text as it is the text used for this Anchor tag code. In this example “TTW” is the Anchor text.
<a> tag is supported by almost all web browsers.
To disable Anchor tag in HTML, there is a simple code, but that doesn’t work in modern day browsers. It worked with Internet Explorer.
<a href=”http://techtricksworld.com/” disabled=”disabled”>TTW</a>
CSS is love♥. It is used to adorn your HTML web pages, and that is why we term this as the styling of web pages. Moreover, CSS can do a lot more.
You can disable Anchor tag in CSS as well.
For this, you can just use Pointer-events style, and it will be done.
I am writing an inline CSS code for the same:
<a href=”http://techtricksworld.com/” style=”pointer-events:none; cursor:default;”>TTW</a>
Within the Anchor tag, what 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 becomes not clickable.
<a href=”http://techtricksworld.com/” onclick=”return false;”>TTW</a>
When you do this, you can still see the link on the text but, when you click that, the link won’t open which means the link is disabled.
Even, the whole course of HTML and CSS is very easy but you have to be creative to design beautiful and professional looking web pages.
We will be sharing such small HTML/CSS tricks that would help you do some amazing stuff. Stay tuned!
Short URL: https://ttw.tips/2CRTzcY