AD JB Toolbox 01 EN

HTML Tutorial / Accessibility Basics: Headings, Links, Images, and Keyboard

Accessible HTML starts with choosing elements for their meaning. Use headings in a logical order, write links that reveal their destination, give images appropriate alternatives, and make sure people can complete interactions with a keyboard.

Use headings to describe hierarchy

A heading is not merely large text. It marks a level in the document: a page topic may use h1, major sections h2, and their subsections h3. Do not jump to h4 because you like its default size; adjust appearance with CSS. Someone reading only the headings should be able to understand the page's outline.

For example, “Delivery information” can be a main section, with “Delivery areas” and “Delivery times” as subsections. Avoid empty headings or headings that do not match the text below. The heading hierarchy helps people scan visually and navigate with assistive technology.

Make links and images understandable

A list of links all named “here” gives little clue about their destinations. Write the purpose in the link text, as in <a href="guide.html">Read the user guide</a>. If the link downloads a file, make its type clear in the surrounding context.

An informative image's alt text should convey the information it contributes here. A purely decorative image that repeats nearby text may use alt="". An image used as a link must also convey the link's purpose, such as “Open the user guide.” Avoid listing every visible color or shape when the function is what matters. The W3C WAI image decision tree helps decide which alternative is appropriate.

Try the page without a mouse

  1. Use Tab to move through links, form fields, and buttons.
  2. Check that the focused element is visibly identifiable.
  3. Activate controls using Enter or Space as appropriate.
  4. If a form reports an error, read it, return to the field, correct the value, and submit again.

A div with only a click handler does not automatically gain a button's meaning or keyboard behavior. Use a for navigation and button for actions. If a menu or disclosure opens and closes, check where keyboard focus moves afterward. Focus should not disappear into hidden content, and the navigation order should roughly match the reading order.

Typically, a focused link opens with Enter, while a button activates with Enter or Space. Choosing an element that matches navigation or action gives keyboard users the behavior they expect, rather than forcing a link to imitate a button or vice versa.

Understand what testing can and cannot prove

An automated checker can find some markup errors, but it cannot always judge whether a link is understandable or an image description is useful in context. Combine tool results with keyboard testing, zooming, and, when appropriate, a screen reader. Start with the site's important user journeys rather than treating a zero-error report as a guarantee. The MDN guide to HTML accessibility covers more native HTML patterns.

More in This Category
HTML Tutorial / Create Expandable Content with details and summary

HTML Tutorial / Create Expandable Content with details and summary

Create keyboard-operable expandable content with details and summary, and decide when to start it open or show content directly.

HTML Tutorial / Use textarea, select, option, and button

HTML Tutorial / Use textarea, select, option, and button

Create multi-line fields, selection lists, and form buttons while understanding initial values, submitted values, and reset behavior.

HTML Tutorial / Group Images and Captions with figure and figcaption

HTML Tutorial / Group Images and Captions with figure and figcaption

Use figure and figcaption to keep an image and its visible explanation together, and distinguish captions from image alt text.

HTML Tutorial / Lists: ul, ol, dl, and Nested Lists

HTML Tutorial / Lists: ul, ol, dl, and Nested Lists

Choose the right HTML list for ordered items, unordered items, and name–description pairs. Try a complete example, custom numbering, and correctly nested lists.

HTML Tutorial / Form Structure and GET vs. POST

HTML Tutorial / Form Structure and GET vs. POST

Understand how form action, method, and control names determine where form values go, and when GET or POST is appropriate.

HTML Tutorial / What Is HTML and What Does It Do on a Web Page?

HTML Tutorial / What Is HTML and What Does It Do on a Web Page?

HTML gives web content structure and meaning. Learn how it differs from CSS and JavaScript, see how basic markup appears in a browser, and make your first HTML file.

HTML Tutorial / Images: img, Alt Text, and Dimensions

HTML Tutorial / Images: img, Alt Text, and Dimensions

Add an image with HTML img, write useful alternative text, and set width and height correctly. A downloadable example helps you test file paths and sizing.

HTML Tutorial / Add Placeholder Text to Form Fields

HTML Tutorial / Add Placeholder Text to Form Fields

Learn how to add placeholder hints to HTML input and textarea fields without confusing them with labels or initial values. Includes a complete form example, required-field checks, and an explanation of empty values in submitted data.

HTML Tutorial / Set the Page Title, Description, Language, and Encoding

HTML Tutorial / Set the Page Title, Description, Language, and Encoding

Build a complete HTML document with title, meta description, language, UTF-8 encoding, and viewport settings, then check their effects.

HTML Tutorial / Connect Labels and Inputs Correctly

HTML Tutorial / Connect Labels and Inputs Correctly

Connect labels to inputs with for and id, distinguish id from submitted name, and learn why placeholder text cannot replace a label.