InfoparkDailyCAREER TOOLS

HTML · Lesson 4 of 9

Links

The <a> element, absolute vs relative URLs and opening in a new tab.

Links are made with the anchor element: <a href="URL">text</a>.

  • Absolute URL — a full address: https://example.com/page.
  • Relative URL — a path on the same site: /jobs/ or about.html.
  • Page section — href="#contact" jumps to the element with id="contact".
  • Email / phone — mailto: and tel:.

Add target="_blank" rel="noopener" to open a link in a new tab safely. Write link text that makes sense on its own — avoid “click here”.

Edit the code and press Run (or Ctrl/⌘ + Enter). Code runs only in your browser, in a sandbox.

  • href holds the destination.
  • #id links jump within a page.
  • Use rel="noopener" with target="_blank".

Which href jumps to an element with id="faq" on the same page?

Create a navigation of three links: one to another site in a new tab, one to an #about section on the same page, and one mailto link.

Why add rel="noopener" to target="_blank" links?

It stops the new page from getting access to window.opener, which could otherwise be used to redirect your page (tab-nabbing).

Absolute vs relative URL?

An absolute URL includes the scheme and domain (https://…). A relative URL is resolved from the current page or site root (/jobs/).

Official documentation, linked for deeper study. These are outside sites; this lesson's text is our own.

Original lesson written by the InfoparkDaily team · © 2026 InfoparkDaily · Free to learn — no paid course or subscription.