back next

The Link Tag


Each web site, and each page has a unique address. This address is called a Uniform Resource Locator, or url. When someone tells you to visit their sit at http://www.mysite.com, they've just given you a url.

To create a link in an HTML page, you use the HTML link tag <a>...</a>.

All the text between the opening and closing tags will become the actual link on the screen and be highlighted, underlined, or colored when the web page is displayed. That's the text you or your reader will click on to jump to the place specified by the href attribute.

<a href="test.html">Go Back to main page</a>
test.html = file to load when link is selected
Go Back to main page = Text that will be highlighted


Example
<html>
<head>
<title> HTML Tutor </title><head>
<body>
<p>Go Back to <a href="test.html">main page</a>
</body>
</html>



Output
result




Links to other documents on the web.
The HTML code you use to link pages on the web looks exactly the same as the code you used for links between local pages. You still use the <a> tag with an href attribute.

<a href="http://cnn.com"> CNN Web site </a>



Back to HTML tutor homepage | Back | Next | Email me