HTML Hyperlink



HTML Tutorial > HTML Tags > HTML Hyperlink

<a>

The essence of an HTML document lies in the first two words: (H)yper(T)ext. In other words, it is the ability to link to other documents that makes HTML unique. How do HTML documents link to other documents? It does so via the <a> tag. The attributes for the <a> tag are href and name. Below we show an example for each:

Example 1: Link to an external document.

HTML:
<a href="sample.html">This link</a> takes you to a document called "sample.html."

Display:
This link takes you to a document called "sample.html."

Example 2: Link to an anchor within the same document.

HTML:
<a href="#atag">This link</a> takes you to a pre-determined location on the same page.

Display:
This link takes to a you to a pre-determined location on the same page.

Note that you may also link to an anchor within an external document.

Next: HTML Image





Copyright © 2014   1keydata.com   All Rights Reserved     Privacy Policy