All subjects · Information Technology · WIT12 3 hour practical exam on web development with HTML, CSS and JavaScript
Hyperlinks: internal, external, email, new tab and anchors
Edexcel IAL Information Technology · WIT12 3 hour practical exam on web development with HTML, CSS and JavaScript
Links join pages together. The specification lists six kinds you must be able to write (spec 7.2.5), and examiners have reported lost marks on email links and anchors.
Six kinds of link
| Link | Example href | Notes |
|---|---|---|
| Internal (another page on the same site) | about.html or pages/contact.html | A **relative** path from the current file: no http |
| External (another website) | https://www.example.com | An **absolute** URL including the protocol |
| mailto:info@example.com | Opens the user's email program | |
| Open in a new window or tab | with target="_blank" | Add rel="noopener" for security; tell users it opens a new tab |
| A part of the same page | #prices | Jumps to the element with id="prices" |
| A specific part of another page | timetable.html#saturday | The page, then # and the id |
Writing them
<a href="classes.html">Our classes</a>
<a href="https://www.example.com">Example site</a>
<a href="mailto:bookings@example.com">Email the bookings team</a>
<a href="https://www.example.com" target="_blank" rel="noopener">Opens in a new tab</a>
<a href="#prices">Jump to prices</a>
<a href="timetable.html#saturday">Saturday timetable</a>
<h2 id="prices">Prices</h2>A same-page link needs two parts: an id on the destination element, and href="#" plus that id on the link. A common exam error is to put the id on the link itself, or to forget the #.
Relative paths
Relative paths describe where a file is from the current file:
help.html: same folderimages/tree.png: in the images folder inside this folder../index.html: one folder up
Examiners report candidates losing marks for absolute paths to files on their own desktop (for example C:/Users/...): once the work is submitted, those files cannot be found, so images and links break. Always use relative paths in the exam.
Good link text
Link text should make sense on its own ('Download the timetable', not 'click here'): screen reader users often list all the links on a page. Make links visibly different from other text, and style their states with CSS (a:hover, a:focus).
Worked example
A page help.html has a section `<section id="contact">`. Write a link on index.html (in the same folder) that opens help.html at that section.
- The target is another page in the same folder, so the path is help.html.
- To jump to a part of it, add # and the id: help.html#contact.
Answer: `<a href="help.html#contact">Contact help</a>`
Check yourself
- Which href creates an email link?
- email:sales@example.com
- mailto:sales@example.com
- https://sales@example.com
- #sales@example.com
Show answer
mailto:sales@example.com. Email links use the mailto: scheme.
- A heading is `<h2 id="faq">FAQ</h2>`. Which link jumps to it from the same page?
- `<a href="faq">FAQ</a>`
- `<a id="#faq">FAQ</a>`
- `<a name="faq" href="faq">FAQ</a>`
- `<a href="#faq">FAQ</a>`
Show answer
`<a href="#faq">FAQ</a>`. href="#faq" points to the element whose id is faq. Without the # the browser looks for a file called faq.
- What value of the target attribute makes a link open in a new tab or window? Type the value exactly.
Show answer
_blank. target="_blank" opens the link in a new browsing context (tab or window).
- A page is in the site's root folder. A picture is saved in the images folder inside it. Which src is a correct relative path?
- C:/Users/student/Desktop/images/pool.jpg
- /images/pool.jpg/
- images/pool.jpg
- pool.jpg/images
Show answer
images/pool.jpg. A relative path from the root folder is the folder name, a forward slash and the file name. Desktop paths break when the work is moved or submitted.
- Examiners report that some candidates lost marks because images 'did not display' after submission. Explain why using an absolute path to a file on the candidate's desktop causes this.
Show answer
The path points to a location on the candidate's own computer, so when the folder is moved or submitted the file is not found at that location and the image does not load.. An absolute path names a fixed place on one machine. On the examiner's computer that place does not exist, so the browser cannot find the file. A relative path works wherever the folder is copied.
- Which link is an external link?
- `<a href="news.html">News</a>`
- `<a href="#news">News</a>`
- `<a href="https://www.example.org/news">News</a>`
- `<a href="../news.html">News</a>`
Show answer
`<a href="https://www.example.org/news">News</a>`. External links give the full URL of another website, including the protocol.
Sources
- Pearson Edexcel International Advanced Subsidiary/Advanced Level in Information Technology specification (first teaching 2018), Unit 2 Topics 7 to 11
- Pearson qualifications: Edexcel International Advanced Level Information Technology (2018)
- Pearson WIT12/01 examiner report, June 2025 series
- Pearson WIT12/01 examiner report, June 2023 series
Last updated 8 November 2026. Spotted a mistake? Tell us.