Links (a and href), online
Six activities your students do on their own devices. See who's finished, and their scores.
Links (a and href) in one minute
What students need to know
href="guide.html" is the destination. The <a> element sits inline inside the paragraph. <a> is the anchor element for hyperlinks. <link> is a head element used to attach stylesheets - it does not create clickable links.
href holds the URL destination on <a> elements. src is used on <img> and <script> to specify a file path. Relative URLs like about.html point to pages within the same site. Absolute URLs include the full protocol: https://example.com.
Mistakes students make
- The href attribute is missing its value. It must be href="url" with a destination URL in double quotes.
- The href value is missing its closing double quote. It should be href="index.html".
- <href> is not an HTML element. Links use the <a> element: <a href="about.html">About</a>.
- HTML tag names must be lowercase. <A> and </A> are non-standard - use <a> and </a>.
What students will learn in this module
Every question in Module 16
Quick questions
- Which element is used to create a hyperlink in HTML?A<a>B<link>
- Which attribute on <a> sets the link destination?AsrcBhref
- True or false: href="about.html" is a relative URL.ATrueBFalse
- What goes between the opening and closing <a> tags?AThe visible link text the user clicksBThe href URL value
- True or false: <a> without an href attribute is invalid HTML.ATrueBFalse
Key terms
Students type the meaning of:
href
Match the pairs
<a href="about.html">About us</a>Match it to what it does<a href="https://bbc.com">BBC</a>Match it to what it doeshref specifies the URL destination - without it the anchor has no link to followMatch it to what it does<a> is an inline element - it wraps text inside block elements like <p> or <li>Match it to what it does<a href>Click here</a>Match it to what it does<href="page.html">Go</href>Match it to what it doesFill in the blanks
<a ___="about.html">About</a>
Hint: Type the attribute name that sets the link destination URL
<___ href="contact.html">Contact</a>
Hint: Type the element name used to create a hyperlink
<p>See the <a ___="faq.html">FAQ</a> page.</p>
Hint: Type the attribute that provides the URL destination for this link
<a ___="https://example.com">Visit</a>
Hint: Type the attribute name that holds the full URL for an external link
<a href="home.html">Home</___>
Hint: Type the element name for the closing tag of a hyperlink
Spot the error
Question 1
A<a href>Click here</a>B<p>Some text.</p>C<p>More text.</p>
Question 2
A<p>Visit our site:</p>B<a href="index.html>Home</a>C<p>Thanks for visiting.</p>
Question 3
A<nav>B <a href="home.html">Home</a>C <href="about.html">About</href>D <a href="contact.html">Contact</a>E</nav>
Question 4
A<ul>B <li><a href="one.html">One</a></li>C <li><a href="two.html">Two</a></li>D <li><A href="three.html">Three</A></li>E</ul>
Question 5
A<p>Links below:</p>B<a href="news.html">News</a>C<a href="sport.html">Sport</a>D<a href="weather.html">Weather</a>E<a>Travel</a>
