HTML & CSS Course
HTML & CSS
/
Intermediate

Keyboard Navigation

Definition

The ability to fully navigate and interact with a website using only a keyboard (primarily the Tab, Space, Enter, and Arrow keys), without a mouse.

Explain Like I'm New

Many users have motor disabilities that prevent them from using a mouse. They navigate by pressing the 'Tab' key to jump between clickable elements. If your website is built properly, every link, button, and form field can be reached and activated with just a keyboard.

Real World Example

Try navigating Amazon.com using only the Tab key. You will see a blue outline jump from link to link.

Common Use Cases

  • •Accessibility for motor-impaired users
  • •Power users who prefer keyboard shortcuts

Interactive Example

Interview Questions

basic

  • Which key moves you FORWARD through clickable elements, and which key moves you BACKWARDS?

intermediate

  • What is the CSS `:focus` pseudo-class?

Flash Cards

Question

Forward and Backward?

Click to reveal answer
Answer

`Tab` moves forward. `Shift + Tab` moves backward.

Question

What is :focus?

Click to reveal answer
Answer

It is the CSS selector used to style the element that currently has the keyboard's attention. If you remove the focus outline (e.g., `outline: none;`), keyboard users literally cannot see where they are on the page.