To create our links, we need to use an anchor (<a>) tag.
Anchor tags are useful when we want our users to be able to send us an email from a link on
our page. They also allow us to link our web pages together, and link them to other pages on the Internet.
- First lets learn about creating a link that will navigate to a specific location on the page we are currently viewing
at the top of our page, right after the body tag, type
<a name="top"></a>.
This step allows us to place an anchor on the page, with the name top. (note: this is only useful for pages that scroll off
of the current page) At the bottom of our page we will insert a link to the top like this, <a href="#top">Back to Top</a>.
Try it NOW!. The href is our reference URL, which tells our browser where we wish to link to.
- Now we can do an e-mail link, type
<a href="mailto:yourname@yourisp.com">email me!</a>.
and that is all there is to it. Just use the href="mailto:" dont forget the colon (:), followed by your email address, and when your
page user clicks the link their mail agent will open filling in your name in the send to box.
- Linking to other pages on our website. The same rule applies here as the inserting picture src reference. If the page we are linking to
is in the same folder (directory) as the current page, we type
<a href="mypage.html">link to my other page</a>.
and if it is in a different folder we type <a href="other_folder_name/mypage.html">link to my other page</a>.
- If we want to link to a specific section of another page we can type
<a href="otherpage.html/#name_of_anchor>specific location on another page</a>.
Note the first link example on naming sections of our page.
- Finally we can link to another webpage like this,
<a href="http://www.justaboutme.20megsfree.com">Visit this cool page</a>.
When linking to other webpages on the Internet, we must remember to use the Full URL (including the "http://"), this will assure us to link to the correct page.