TutreNews Learn

Links, images and lists

Links

Goal: Create absolute, relative and in-page links · 8 min

Links use the anchor element: <a href="target">link text</a>.

  • Absolute URL: https://example.org/about — another website.
  • Relative URL: about.html, ../images/logo.png, /contact — within your own site (/ starts at the site root, .. goes one folder up).
  • Fragment: #faq jumps to the element with id="faq" on the same page.
  • mailto: and tel: open e-mail or phone apps.

Write descriptive link text: "Download the timetable (PDF)" instead of "click here" — screen-reader users often list all links out of context. target="_blank" opens a new tab; use it sparingly.

Worked example: Three kinds of links

  1. External: full https URL.
  2. Internal: relative path to another page.
  3. Fragment: jumps to id="contact" further down.
<a href="https://www.w3.org/">W3C</a>
<a href="team.html">Our team</a>
<a href="#contact">Contact</a>
<h2 id="contact">Contact</h2>