HTML CSS IMAGES LINKS
 
HTML → Linking

There are two types of links: Relative and Absolute

Relative Link - Linking to another file within the same site structure. In essence any page within the top most directory of your site or anywhere below it. For a relative link to work, both files must exist within your folder structure. In the example below, our webpage will link to another HTML file called headings.htm. Both this file and headings.htm are in the same folder.

While HTML is not case sensitive, file names and paths are.

<a href="heading.htm">go to headings</a>

go to headings

HREF stands for Hypertext REFerence. You indicate what HTML file you want to reach. Between the opening of the anchor tag and the closing of the anchor tag, you place a clue for the viewer to see. In our example it is - go to headings. This will appear as blue and underlined, unless we change the color of our link. Once you visit the linked page and return to this page, the color of the link will be purple (unless we change that as well).

<html>
<head>
<title>HTML Construction</title>
</head>
<body>

<a href="headings.html">go to headings</a>
</body>
</html>

Absolute Link - When linking to a document residing beyond the structure of your site, you must code an absolute URL. An absolute link will specify the full web address of the page or document your are linking to. An example of an absolute URL is

http://www.pbs.org/treasuresoftheworld/a_nav/guernica_nav/main_guerfrm.html

<html>
<head>
<title>HTML Construction</title>
</head>
<body>
<a href="
http://www.pbs.org/treasuresoftheworld/a_nav/guernica_nav/main_guerfrm.html">
Guernica: Testimony of War</a>
</body>
</html>

 
  back ↑