HTML links

It is a connection from one web resource to another page and web .we can click on a link and jump to another document and web.

Note :-   A link can be an image or any other HTML element .

HTML Link - Syntax :

We also know the html link tag as an anchor and Hyperlink tag. Hyperlinks are defined with the HTML <a> tag:

<a href="url">link tag example</a>

Example :

<!DOCTYPE html> 
      <h2>HTML Hyperlink and anchor </h2>
      <p> <a href="">Visit StackOverlode</a> </p>

The href is a attribute specifies the destination address ( of the link.

Links in html are of two types.

  • Internal Hyperlinks
  • External Hyperlinks

Internal Hyperlinks

An internal link is a type of hyperlink on a webpage to another page or resource, such as an image or document, on the same website or domain.

External Hyperlinks

An External link is great future to drive a webpage one to another and useful for surf many web page in website.

Example : -

<!DOCTYPE html> 
   <h3>Internal Hyperlinks And External Hyperlinks Example</h3>
      <p><a href="demo.html">Internal</a> It is a link to the contribute page on stack overlode ' website.</p>
      <p><a href="">External </a> It is a link to the Stack Overlode website on the World Wide website.</p>

The target and Attribute in  HTML Links 

The HTML target attribute specifies where to open the linked document web and image.

There are few targets in HTML attribute can have one of the following values:

Target Attribute Description
_blank  Opens the linked document in a new tab or window.
_parent Opens the link in the parent frame. Frames are deprecated in HTML5.
_selfOpen the link in the current frame.
_top Opens the link in the top-most frame. Frames are deprecated in HTML5.

This example will Opens the linked document in a new tab or window. :

This example will Opens the link in the parent frame. Frames are deprecated in HTML5 :

Stack Overlode is optimized Tutorials and examples for learning and training. Examples might be simplified to improve reading and learning and understand. Tutorials and examples are constantly reviewed to avoid errors, but we cannot warrant full correctness of all content. While using Stack Overlode, you agree to have read and accepted our terms of use, cookie and privacy policy.