Quiz Entry - updated: 2026.06.20
What is the difference between external and internal links?
External links point outside the current document (usually with a full URL); internal links jump within the same page using # plus an element's id.
An external link sends the user to a separate document — typically on another site — so it carries a full URL including the protocol (https://):
<a href="https://www.hslu.ch">HSLU Website</a>
An internal link stays on the same page and scrolls to a specific spot. You mark the target with an id attribute and reference it with # followed by that id:
<a href="#chapter1">Jump to Chapter 1</a>
...
<h2 id="chapter1">Chapter 1</h2>
The mechanics to remember:
- The link's
hrefis#plus the target'sidvalue. - That
idmust be unique within the document, since it names one exact location. - Clicking scrolls the page to the element bearing that id (any element can have an id, not just headings).
This powers familiar patterns like a table of contents, "back to top" links, and navigation within a long single-page document.