HTML Hyperlink
By Saket Bhatnagar••Beginner to Intermediate
hyperlink
- 1Hyperlinks are used to link our webpage with some other documents or other part of document.
- 2Hyperlinks are created using the <a> (anchor) tag and are usually displayed as underlined text in blue color.
- 3To provide path or hyper reference we have to use href attribute of <a> tag.
Anchor Tag
- 1Anchor tag is used to create a hyperlink on a web page.
- 2It is container tag.
- 3It is inline level element.
- 4The content that we want to create as a hyperlink should be written within <a>..</a> tag.
- 5Syntax:- <a> ..text.. </a>(Here, we have marked the text to create hyperlink.)
Attributes of Anchor Tag
- 1 href attribute - It is used to provide path or hyper reference to the marked content. When user clicks on hyperlink that hyperlink takes the user to the specified path given in href attribute. (<a href="path"></a>)
- 2 target attribute - It is used to specify where to open the hyperlink. <a target="_blank"></a> means that our hyperlink will open in a new tab.
Example
- 1<a href = 'https://www.google.com' target="_blank"> Google</a> is a search engine.
Here, we have marked Google text to create hyperlink and when we click on the text,it will take us to the path specified in the href attribute i.e., google website.