<a href="...">Label</a>
<a name="..."></a>
<a href="mailto:..."></a>Hyper-links are what distinguish HTML documents (e.g. Web pages).
<a href="personal.html">Boris Badenov's Personal Page</a> <a href="project/intro.html">Term Project</a> <a href="http://www.mhuffman.com/notes/html/html_2.html">HTML Hyper-links</a>
The first link uses a relative path; it tells the browser to look in the same directory (e.g. folder in Windows speak). The second link is also a relative path; it tells the browser to look in the directory called project for the file intro.html. The third link uses an absolute path, also called a Fully Qualified Domain Name (FQDN). Use relative paths for all links to documents, images, etc. that are in your hosting site directory structure.
Do NOT do something like this:
<a href="http://cs.clark.edu/~bbade1234/personal.html"> Boris Badenov's Personal Page</a>
|
|
The name attribute creates a named label within a document to link to. Note the various [ TOP ] links in this document. Somewhere near the top of the page where I want a viewer to return to, typically a "Table of Contents", I write an anchor tag like this:
<a name="TOP"></a> <!-- "address" within a document -->
Then elsewhere in the document, say at the bottom, or on a page that has major sub-sections, at the bottom of each section, I write a link like this:
<a href="#TOP">TOP</a> <!-- link to label within document -->
Note in particular the "#" character prefix to the "address" I am linking to (which is essentially a named lable within the document).
You can also link to a named address in a different document (provided, of course, that the document you are linking to has a named label). For example, using a relative path to the Resources Page I can direct a viewer to a specific section of that page, in this case the "HTML, Web Hosting, and JavaScript" section of the Resources index page:
HTML, Web Hosting, and JavaScriptHere is the HTML:
<a href="../../resource/index.htm#HTML"> HTML, Web Hosting, and JavaScript</a>
An email hyper-link is just the basic anchor HREF element where you use an email address prefixed with "mailto:"
Email Boris Badenov, World Champion No-Goodnik, at the Ukrainian Safecracking College: bbadenov@usc.edu
The HTML:
Email Boris Badenov, World Champion No-Goodnik, at the Ukrainian Safecracking College: <a href="mailto:bbadenov@usc.edu">bbadenov@usc.edu</a>