Skip to main content
Brave Programmer Logo

BraveProgrammer

BraveProgrammer

HomeProjectsBlogsCoursesLessonsAbout

Site footer

BraveProgrammer

Free coding courses, practical tutorials, and real projects from BraveProgrammer. Learn web development with React, Next.js, and TypeScript.

Navigation

  • Home
  • Projects
  • Blogs
  • Courses

Resources

  • About
  • Lessons
  • Teach on BraveProgrammer

© 2026 BraveProgrammer. All rights reserved.

Hyperlinks and Navigation | HTML Course lesson | BraveProgrammer
  1. Courses
  2. /
  3. HTML Course

Lesson 52 of 55

·HTML

Hyperlinks and Navigation

10 min

Course progress95%

What you'll learn

Keep these ideas in mind as you work through the lesson.

5 points
  • Anchor element attributes (`href`, `target`, `rel`, `title`)
  • Security considerations for external links (`noopener noreferrer`)
  • Descriptive link text for accessibility and SEO
  • Using `<nav>` landmarks and ARIA labels
  • Keyboard‑focus best practices

Hyperlinks (<a>)

<a href='https://developer.mozilla.org' target='_blank' rel='noopener noreferrer'>MDN Web Docs</a>

Core attributes

  • href – Destination URL; can be absolute (https://…) or relative (/about.html).
  • target='_blank' – Opens the link in a new tab/window.
  • rel='noopener noreferrer' – Prevents the new page from accessing window.opener (security) and stops the referrer header from being sent.
  • title – Optional tooltip that provides additional context.

Navigation best practices

  • Wrap primary navigation in a <nav> landmark for screen‑reader discoverability.
  • Use descriptive link text that makes sense out of context (avoid “click here”).
  • Keep URLs human‑readable (/projects/web-app) – aids SEO and usability.
  • For intra‑page jumps, use hash links (#section-id).
  • Ensure links are focusable and display a visible outline when navigated with the keyboard.

Quick checklist for safe external links

  1. target='_blank'? ✅
  2. rel='noopener noreferrer' present? ✅
  3. Link text descriptive? ✅
  4. URL human‑readable? ✅
  5. Keyboard focus visible? ✅

Tip: Test navigation with only a keyboard (Tab/Shift‑Tab) to confirm focus order and visible outlines.


Try it yourself

Create a simple navigation bar with three links – Home, About, Contact – and wrap the list in a <nav aria-label='Main navigation'> element. Verify it appears in the browser’s Accessibility tree.

Make it stickPractice what you've learned1 quiz · 2 practical tests · Optional activities from HTML CourseBrowse activities
Previous lessonPreparing for HTML2026 – Emerging StandardsContinue to lesson 53ImagesBack to HTML Course curriculum