Links
What can you link to? Links are the heart of HTML.

Linking to an Internet site URL address):

<a href="http://www.mc3.edu/">Click to go to Montco</a>

would look like this on the web page:
Click to go to Montco

And would take someone to the mc3.edu website when clicked

Click to go to <a href="http://www.mc3.edu/">Montco</a>

Would look like:
Click to go to Montco

With only the word Montco linked to the website

Everything within the <a href=""></a> tags is part of the link, this can include images and multiple lines of text.

So you can write <a href="http.www.umd.edu"><img src="goterps.gif"></a> to turn the terp picture into a link to the University of Maryland.

Linking to other pages and files
If the pages for your website are all in the same directory you can link to them using:

<a href="page2.htm">Go to page two</a>
<a href="resume.doc">Resume in Microsoft Word format</a>

Linking within a page

  1. The only time you use a "#" in a link is when linking to a target within a page
  2. Every target you link to must first be defined with an <a name=..> command
<a name="middle">This is a new section</a> this defines a place to jump TO  **NOTE: no "#" in the name
<a href="#middle">Return to the new section</a> will jump to the section earlier labeled as middle from within the same page.
<a href="otherfile.htm#middle">Go to new section</a> will jump to the section labeled middle on the page otherfile.htm from another page.

Link to e-mail
General form:  <a href="mailto:emailaddress@host.domain">text to display</a>
For example if you want to send mail to me (mailto:dianne_meskauskas@hcpss.org) when when the words "click here to send mail" are used you type:
<a href="mailto:dianne_meskauskas@hcpss.org">click here to send mail</a>

Practice:
Write the code to jump to an target called TOP on a separate page called page2.htm when the words "See detail section" are clicked. ________________________________________
Write the code to send a message to the president (president@whitehouse.gov) when the words "Write to the president" are clicked. __________________________________