1. <
< HTML
Lesson 3: Linking It All Together
By Olivia Moran
[Codo Dojo – HTML Group Sligo, Ireland]
liviamoran.me
www.oliviamoran.me
http://www.slideshare.net/oliviamoran
3. A tag
What is it?
• The HTML <a> tag defines a hyperlink.
• A hyperlink (or link) is a word, group of words, or
image that you can click on to jump to another
document.
• When you move the cursor over a link in a Web
page, the arrow will turn into a little hand.
4. A tag
What is it?
• By default, links will appear as follows in all
browsers:
An unvisited link is underlined and blue
A visited link is underlined and purple
An active link is underlined and red
6. Target Links
The target attribute specifies where to open the
linked document. The example below will open
the linked document in a new browser window or
a new tab:
<a href="http://www.rte.ie/">
target="_blank">Visit W3Schools!</a>
7. Linking To Parts Of A Page
<html><body>
<p><a href="#C4">See also Chapter 4.</a></p>
<h2>Chapter 1</h2><p>This chapter explains ba bla bla</p>
<h2>Chapter 2</h2><p>This chapter explains ba bla bla</p>
<h2>Chapter 3</h2><p>This chapter explains ba bla bla</p>
<h2><a id="C4">Chapter 4</a></h2><p>This chapter
explains ba bla bla</p>
<h2>Chapter 5</h2><p>This chapter explains ba bla bla</p>
<h2>Chapter 6</h2><p>This chapter explains ba bla bla</p>
</body></html>
8. Email Link
<html><body>
<p>This is an email link:
<a href="mailto:someone@example?Subject
=Hello%20again"> Send Mail</a>
</p>
<p>
<b>Note:</b> Spaces between words
should be replaced by %20 to ensure that the
browser will display the text properly.
</p>
</body></html>
9. HTML Game (index.html)
<html><body>
Your name is <b><i>Codo Dojo</i></b>
You are standing in front of a castle
surrounded by a <b>shark filled</b> moat.
You can <i>enter</i> the castle or
<i>jump</i> in the moat.
<p><a href ="room1.html">Enter</a> or
<a href="room2.html"> Jump
</a></nowiki></p>
</body></html>