Marking up objects turns them into hyperlinks

Using anchor tags to link to other locations

This is straightforward. You can anchor some text to our course home page by adding the following code to a well-formed page.

<a href="http://ils.unc.edu/courses/2014_spring/inls101_002/index.html">The INLS101-002 Home Page</a>

  • The above "anchor" can appear anywhere between the <body> and </body> tags.
  • href is an attribute of the tag. In this case, href indicates what web page is on the other end of the link you just created (in other words, what page should get fetched if you click on the link).
  • Each tag in HTML has a set of possible attributes, some required, some optional. The best ways to learn about the possibilities is to consult an HTML reference and to look at HTML source.
  • Note that like other tags, the <a> anchor tag must be mirrored with an </a> close anchor tag. You are connecting everything between the two tags to that anchor.

[top]

One may add anchors to create links to pages within and without a web structure.

<p>Today's session has three pages. Specifically, the three pages are</p>
<ol>
<li> <a href="sessions.10.info-structures.02.markup.a.html">HTML Theory</a> </li>
<li> <a href="sessions.10.info-structures.02.markup.b.html">Tags</a> </li>
<li> <a href="sessions.10.info-structures.02.markup.c.html">Hyperlinks</a> </li>
</ol>

Or, as it will display on the page


Today's session has three pages. Specifically, the three pages are

  1. HTML Theory.
  2. Tags.
  3. Hyperlinks

[top]

Note the difference between anchors and the references they use:

An ABSOLUTE REFERENCE takes you to one and only one specific location.

<a href="http://ils.unc.edu/courses/2014_spring/inls101_002/"> INLS101-002 Foundations of Information Science</a>

In our case, we used an absolute reference to go to our class home page.

A RELATIVE REFERENCE takes you to a location that is hierarchically relative to the specific location of the reference.

<a href="sessions.10.info-structures.02.markup.a.html">HTML Theory</a>.

[top]


theory | tags | LINKS |