HTML Links

Links are very important in HTML documents as they are used to direct users or visitors of a website from one webpage to another.

In HTML links are created using the <a> tag. An simple example of a HTML link is below:

<a href="http://scriptsbytes.com">Go to SCRIPTSBYTES.COM</a>

Result will look like this Go to SCRIPTSBYTES.COM

The example above is a simple example of a HTML link. The <a> tag is used to create the link with the href attribute to specify the link address.

Target Attribute

The target attribute is used to add additional features to a general link. We can make a link open in a new tab or a new window.

<a href="http://scriptsbytes.com" target="_blank">Go to SCRIPTSBYTES.COM</a>

Result will look like this Go to SCRIPTSBYTES.COM with the link opening in new tab.

Name Attribute

The name attribute is used to add an anchor to link to a part of an HTML document within the same document or webpage.

We can create an anchor below

<a name="welcome">Welcome to SCRIPTSBYTES.COM</a>

And create a link within the same document to go to that part of the webpage

<a href="#welcome">Go to the welcome message</a>

We can also create a link to that part of the page from a different page

<a href="http://scriptsbytes.com/home.html#welcome">Go to the welcome message</a>