What is a href in HTML

<a href="link">text</a>
<a href="http://example.com" >Link text</a>
Actually href is a html attribute, which is used for passing page url to the a tag.
Example
<a href="url">Click here</a>
<a href="#"><!-- The "#" to be replaced with filename or website address -->Go Somewhere</a>
<a>
"anchor"
<!--meaning it is used to create a hyperlink to another webpage or elements within the same webpage-->
</a>

<!-- this is a link tag -->

<link rel="" href="">
<!-- href is the location of your external ressource

list of rel used with a link tag (popular) :
- stylesheet (css)
- alternate
- author
- external
- incon
- index
-->

Leave a Comment