← Previous Next →

Html links allow users to move from page to page. It is a pointer from one HTML document to another one.

HTML Links - Hyperlinks

HTML links are hyperlinks. A hyperlink is a text or an image you can click on, and jump to another document.


In HTML, links are defined with the tag:

<a href="url">link text</a>


<a href="http://www.breakinterview.com/tutorial/html/">Go to our HTML tutorial</a>

The href attribute specifies the destination address : http://www.breakinterview.com/tutorial/html
The link text is the visible part (Go to our HTML tutorial).
Clicking on the link text, will send you to the specified address.

Note: The link text does not have to be text. It can be an HTML image or any other HTML element.

Local Links

The example above used an absolute URL (A full web address). A local link (link to the same web site) is specified with  relative to current URL (without http://www....).


<a href="html_title.php">HTML Title</a>

HTML Links - The target Attribute

The target attribute specifies where to open the linked document( on the same tab or a new tab/window). This example will open the linked document in a new browser window or in a new tab:

<a href="http://www.breakinterview.com/" target="_blank">Go Breakinterview!</a>
← Previous Next →