All Topics
Accessible HTML
Exercise 3 - Fix Some HTML

HTML Exercise

Let’s fix some HTML code in an example!

Go through the form fields, “buttons”, images, links and content sections. See what markup and controls (interactive components) you can improve with standard HTML elements and attributes.

Play with labeling of controls, keeping in mind the Label in Name (opens in a new tab) criteron in the Web Content Accessibility Guidelines (among other success criteria). See debugging tips below.

Background

Cart, contains items

/

Debugging tips 🧐

To debug and verify behavior of your HTML, use these tools and techniques:

  • Use your keyboard to ensure controls are reachable and operable.
  • Try out Landmarks, Headings, and Accessible Names under Ad-hoc tools in Accessibility Insights (opens in a new tab).
  • Inspect the DOM to see how content and controls are marked up:
    • Are prominent pieces of text in h1-h6 tags, creating an overall outline?
    • Are groups of items in unordered or ordered lists?
    • Are HTML elements used according to their specifications, such as listitems as children of a list?
    • How are forms marked up? Are individual fields properly labeled? Are there fieldset groups?
    • Do buttons look like buttons, and links look like links?
  • Run an extension like Axe (opens in a new tab) to see if there are any other violations related to HTML content structure, landmarks, or ARIA (sneak peek to the next section).
  • Fire up VoiceOver or NVDA and navigate through the page. How are interactive components presented? What can you learn from the VoiceOver rotor or NVDA Elements List?