HTML Tutorial - HTML Text Link


In a website there are many webpages that are linked to each other to make it work. These links in between pages are done using the <a> tag, that is called as hyperlink.

The <a> tag can be used to link other websites. Also, can be used as links that download files.

The <a> tag is called as Anchor Tags. Shown below are the examples of <a> tag usage.

HTML <a> Tag Example:

Source: Result:



The <a> tag using different values for target attribute:
  • "_blank" is used to load the webpage in new window
  • "_self" is used to load the webpage in the current frame
  • "_top" or "_parent" is used to load the webpage in the same window
HTML <a> Tag with different Load options, Example:
Source: Result:



HTML Link to portion of the Webpage


Creating a link, when clicked to show the top portion of the page.

Using the "name" attribute of the <a> Tag to create a link that has to be shown, when clicked at the bottom of the page.

Example:
<h2>HTML Text <a name="top"> </a></h2>

The HTML code below shows how we can create a link, that when clicked will take it to the top portion of the webpage. To do that we need to use the keyword "top", mentioned in the "name" attribute.

Example:
<a href="html_links.html#top">Go to the Top</a>