Department header image of the Bridger Peaks
New Graduate Student Seminar Series

The <a>...</a> Tag ... The Backbone of WebPages
Blue horizontal rule image
<a href="filename"> </a>
This is the tag in HTML that creates a hyperlink to another Web page.
There are four general types of links distinguished by the location of the file you are linking to:

  1. Specifying a URL for a file in the same directory:
    <a href="filename.html">Text you want user to see</a>
    The previous code produces a link that appears as:    Text you want user to see
  2. Specifying a URL for a file in a subdirectory:
    <a href="subdir/filename.html">Text you want user to see</a>
  3. Specifying a URL elsewhere on the same server: (Note beginining slash)
    <a href="/activities/activities.html">Outdoor Activities</a>
    The previous code produces a link that appears as:    Outdoor Activities
  4. Specifying a URL for a file on another web server:
    <a href="http://www.theregister.co.uk/2002/05/19/ms_in_peruvian_opensource_nightmare/"> M$ in Peruvian open-source nightmare</a>
    The previous code produces a link that appears as:    M$ in Peruvian open-source nightmare from The Register.

Other uses of the <a>...</a> tag

  1. Creation of an email link:
    Please <a href="mailto:jarek@math.montana.edu_NOSPAM">email me</a> with your math questions.

  2. The previous code produces a link that appears as:    Please email me with your math questions.
  3. The a href tag is also used to link to postscript and pdf files:
    PDF version of <a href="/~griff/m182/quiz/quiz7.pdf">M182 quiz 7</a>
    The previous code produces a link that appears as:   PDF version of M182 quiz 7
  4. The NAME attribute is used to specify links within a page.
    The links look like: <a href="#bottom">Bottom of the page</a>
    The previous code produces a link that appears as:    Bottom of the page
    The NAME anchor ( <a name="bottom"> ) must be set where you want the browser to land.
    OR another use: <a href="web_2.html">Return to Top of the page</a>
    The previous code produces a link that appears as:    Return to Top of the page
    Note, unlike other attributes, NAME is case-sensitive.
  5. The Target attribute is mostly annoying. but occasionally there is a use like:
    <a href="/help/images/isaac.jpg" TARGET="NewWindow">Isaac</a> at a recent conference
    The previous code produces a link that appears as:    Isaac at a recent conference

Server Side Includes
Blue horizontal rule image

HTML uses the names <tag attribute="argument"> whereas SSI uses <!--#command argument="value"-->.

No spaces are allowed between the opening delimiter <!-- and the start of the command. Similarly, between the end of the command and -->, no spaces are allowed.
The result should look like this:
<!--#configfile="filename.htm"-->. Failure to follow this simple rule will result in the server seeing a <!-- comment --> instead of what you intended.

Example:
This is the time & date command: <!--#echo var="DATE_LOCAL"-->
Tuesday, 12-Feb-2013 06:21:31 MST

The following is a list of the various commands that are documented on the NCSA HTTP web servers.

A Final comment: When the page loads, the commands are executed, and assuming no errors are encountered, what appears when you view the source is the execution of the SSI not the actual command.
A Useful Example - using both SSI and Tables
Blue horizontal rule image
The following code: <!--#include file="schedule.html"--> (or <!--#include virtual="schedule.html"--> in the target file is in a different directory) Will insert the file schedule.html below. Again, I point out, simply putting a space between the open delimiter "<--" and the "#" will turn the SSI into a comment.
[an error occurred while processing this directive]

Blue horizontal rule image

Blue horizontal rule image
Last Modified: Tuesday, 14-Jun-2011 16:52:16 MDT