HTML Links

HTML Links – Hyperlinks

you can add links to your page or you can connect a text with the link

In the html <a> define the hyperlinks let’s see an example:

<a href="url">Text Here</a>

The most important attribute of the <a> element is the href attribute, which indicates the link’s destination. Let’s see an example

<a href="https://hacktube5.tech/">Visit Hacktube5.tech!</a>

HTML Links – Target Attributes

By default, the linked page will be displayed in the current browser window. To change this, you must specify another target for the link.

The Target attributes have 4 value

  1. self – Open the link in the same browser
  2. Blank- Open in a new window/tab
  3. Parent – Open in the parent frame
  4. Top – Open in the full body of the window

Let’s see the example 

Using Blank Tagrte to open file or document in new window/tab

<a href="https://hacktube5.tech/" target="_blank">Visit hacktube5!</a>

Relative URLs

Relative URLs are used for local links

<h2>Relative URLs Test</h2>
<p><a href="html-images.asp">HTML Images</a></p>
<p><a href="/css/default.asp">CSS Tutorial</a></p>

Absolute URLs

Absolute URLs are used for full web address

<h2>Absolute URLs</h2>
<p><a href="https://www.hacktube5.tech/">hacktube</a></p>
<p><a href="https://www.youtube.com/">youtube</a></p>

Leave a Reply