Links
A
The <a> tag is used to create an anchor to link from.
The HREF attribute addresses the document to link to. The NAME attribute is used to create a named anchor.
Named anchors allow us to create links that can jump directly into a specific section on a page. The MAILTO attribute is used in conjunction with HREF and is used to set up a link to an e-mail client.
<a attribute="location of the item to link">linked text</a>
| Attribute | Explaination | Example |
|---|---|---|
| HREF | The address of the document to link to | href="http://www.ncsu.edu" |
| NAME | Used to create a named anchor. | |
| MAILTO | Used to open up an e-mail client to send mail | href="mailto:tamarini@ncsu.edu" |
There are two types of links: Text and Picture.
A text link is a piece of text that when clicked, brings the user to another webpage. An example would be:
<a href="http://eos.ncsu.edu/e115">E115 Course Website</a>
A picture link acts just like a text link but instead of clickable text, it is a picture that when clicked, brings the user to another webpage. Now that you can make a link and place a picture on your webpage, the code is simple:
<a href="http://eos.ncsu.edu/e115"><img src="e115logo.jpg" alt="E115 Logo" /></a>
Always remeber to put in complete URL names and put those names in double quotes ( " ). When referencing another .html page that is in the same folder as your index.html, the syntax is as follows:
<a href="name.html">Page Name</a>
You MUST close your A tag when done with your link otherwise all of the text to follow your link will, whenever clicked on, take the user to the intended link.




