Section 1 - Introduction
Section 2 - Basics
Your first page
Formatting
Text tricks
Pictures
Links
Anchors
External Links
In-site Links
Navigation Links
Pictures
E-mail
Targets
You try it
Backgrounds
Section 3 - Next Level
Section 4 - Advanced
Section 5 - Publishing
Section 6 - Extras
Appendices
|
External links
To get an anchor to actually connect to something, you have to tell it where to go. You will be modifying the anchor tag to have a refrence point, or more accurately, a hyper-reference. This is abbreviated href. The reference is the web address of the site you want to explore. This is how it looks:
- <a href=""> </a>
Between the two sets of quotation marks goes the reference to the site you want to go to. Let's say you want a link to the page "google.com" on your webpage. First. look up the page to make sure you have the complete address. Once you type it in, you find the address has changed to "http://google.com" That "http" is very, very important. You MUST have it when making a link to the "outside world." Here's what that link might look like in a document:
Code |
---|
You will use the anchor tag when you want to
<a href="http://google.com">link</a> one part of the text to something else.
|
|
What you see |
You will use the anchor tag when you want to
link one part of the text to something else.
|
|
Now notice when you move your mouse over the link, it changes into a picture of a hand. Go ahead and click it, but hit the "back" button to get back here.
Sometimes the actual link is very long, but it's done in exactly the same way. For example, if you wanted to link to a page on puffins in the Encyclopędia Britannica, the link is:
- http://www.britannica.com/eb/article?tocId=9061853&query=puffin&ct=
and the code looks like this:
Code |
---|
<a href="http://www.britannica.com/eb/article? tocId=9061853&query=puffin&ct=">Puffins</a> are really cool.
|
|
What you see |
Puffins are really cool.
|
|
Links are that easy to make. And guess what? You've just learned the hardest type of link - the external link. You use this link when linking to another site - one that you don't own and that isn't in the same file as your page. Remember to copy and paste the link. It's much easier and you'll find fewer errors.
Note: When choosing what words to put between the anchor tags, it is usually considered stupid to put the word "link" or "here" or "click" in the tags. Instead, put a short description of where the link is taking the person. And if you care, it's considered bad grammar to make punctuation a link.
|