The Blue Cup now passes validation without errors. But a valid document can still be difficult or impossible to use for many people: someone who can't use a mouse and navigates with the keyboard, someone who can't see the screen and listens to it with a screen reader, someone with low vision who enlarges the text to 200%, someone who can't tell red from green, or someone trying to read their phone in bright sunlight. Web accessibility means designing and building sites that everyone can use, regardless of their abilities and the circumstances in which they browse. Throughout the course you've applied many accessible decisions almost without noticing: alt text, tables with caption and scope, labels in forms, semantics, visible focus, unrestricted zoom. In this lesson you'll learn the framework that gives all of that its meaning: what accessibility is and who benefits from it, what the law and the WCAG guidelines say, and how the key points translate into HTML and CSS. You'll also implement something The Blue Cup has had pending since Module 6: the "Skip to content" link.

Contents

  1. What web accessibility is
  2. Who benefits: permanent, temporary and situational disabilities
  3. The legal framework (in passing)
  4. The WCAG 2.2 guidelines: the POUR principles and conformance levels
  5. Language of the page and of its parts
  6. Alt text (review)
  7. Colour contrast
  8. Not relying on colour alone
  9. Keyboard navigation and focus order
  10. tabindex: 0, -1 and why never positive
  11. Visible focus
  12. The "Skip to content" link
  13. Accessible forms (review)
  14. Motion and prefers-reduced-motion
  15. Project: skip link and contrast review

What web accessibility is

Web accessibility is the quality of a site that allows anyone to perceive, understand, navigate and interact with it, and also to contribute (for example, by filling in a form). It's often abbreviated as a11y: the "a", 11 letters and the "y" of accessibility.

Two ideas to start with:

  • Accessibility isn't an add-on: it's a quality of the code, like being valid or fast. It's much cheaper to build accessibly from the start than to fix it at the end. That's why this course has been introducing it in every module.
  • HTML is accessible by default. A button can be pressed with the keyboard and is announced as a button; an h2 appears in the screen reader's list of headings; a label gives its field a name. Most accessibility problems appear when semantic HTML is abandoned (a div acting as a button) or when CSS hides information (an invisible focus, poor contrast).

Who benefits: permanent, temporary and situational disabilities

According to the World Health Organization, around one in six people in the world lives with a significant disability. But accessibility benefits many more, because limitations aren't always permanent:

Ability Permanent Temporary Situational
Sight Blindness, low vision After a cataract operation; broken glasses A screen in the sun; a phone with the brightness turned right down
Hearing Deafness, hearing loss An ear infection A noisy bar; a train without headphones
Mobility Paralysis, tremors, loss of an arm A wrist in plaster Holding a baby with one arm; standing on the bus
Cognition Dyslexia, intellectual disability, ADHD Concussion; the effects of medication Distractions, tiredness, being in a hurry, reading in a language that isn't your own

People use various assistive technologies and strategies:

  • Screen readers (NVDA, JAWS, VoiceOver, TalkBack): they read the content aloud or in braille and let you navigate by headings, links, regions or fields. You'll try them out in Accessibility Testing.
  • Keyboard-only navigation, or devices that emulate the keyboard (switches, voice control, head pointers).
  • Screen magnifiers and browser zoom.
  • High-contrast modes and the system's forced colours.
  • Captions and transcripts for audio and video.

The well-known curb-cut effect sums up the idea: dropped kerbs were made for wheelchairs, and today they're used by pushchairs, suitcases and delivery workers. Subtitles, designed for deaf people, are used by half the world on public transport. A form with clear labels is easier for everyone.

The legal framework (in passing)

Accessibility is also a legal obligation in many cases. The Blue Cup is in Spain, so here is a rough summary for the European Union and Spain:

Legislation Scope What it requires, in essence
Directive (EU) 2016/2102 Websites and apps of the public sector Compliance with the European standard EN 301 549, which refers to WCAG 2.1 level AA
Royal Decree 1112/2018 (Spain) Transposes the above directive for the Spanish public sector In addition, publishing an accessibility statement and providing a feedback mechanism
Directive (EU) 2019/882, the European Accessibility Act (EAA) Certain products and services in the private sector (e-commerce, banking, transport, e-books…), applicable from 28 June 2025 Accessibility requirements for those services, including their websites; microenterprises providing services are generally exempt
Law 11/2023 (Spain) Transposes the EAA into Spanish law The above, with its supervision and penalty regime

Warning. This table is only a guide so that you're aware of the context. Which rules apply to a particular site (depending on the size of the business, the type of service or the country) is a legal question that changes over time and has many nuances. In a real case, consult a legal professional. From a technical point of view, the recommendation is simple: always aim for WCAG 2.2 level AA, which covers what the legislation in force requires.

The WCAG 2.2 guidelines: the POUR principles and conformance levels

The Web Content Accessibility Guidelines (WCAG) are the international standard, published by the W3C's Web Accessibility Initiative (WAI). The current version is 2.2, from 2023. They're organised into four principles, known by their initials: POUR.

Principle Key question Examples of criteria Examples at The Blue Cup
Perceivable Can the information be perceived with at least one sense? Alt text; captions; contrast; not relying on colour alone; reflow at 400% alt on the photos; video subtitles; interview transcript; a palette with good contrast
Operable Can all the controls and the navigation be used? Everything can be done with the keyboard; visible focus; logical focus order; bypassing repeated blocks; enough time Native controls; :focus-visible; "Skip to content" link
Understandable Can the content and how it works be understood? Language of the page; predictable behaviour; labels and instructions; help with errors lang="en"; identical menu on every page; label and hint texts in the form
Robust Does it work with current and future technologies, including assistive ones? Name, role and value of every component; status messages Semantic HTML; correct ARIA (next lesson)

Each principle is divided into guidelines, and each guideline into numbered success criteria (for example, 1.4.3 Contrast (Minimum)). Each criterion has a level:

Level Meaning Usual use
A The minimum: without it, some people can't use the site Mandatory
AA The level recommended and required by most legislation The goal for any professional site
AAA The most demanding level; it isn't always possible to meet it for all content Applied where possible, criterion by criterion

The levels are cumulative: meeting AA means meeting all the A and AA criteria.

Version 2.2 added, among others, criteria on focus not obscured by sticky headers (2.4.11, AA), the minimum target size for touch or click targets, 24×24 CSS pixels (2.5.8, AA), and accessible authentication, which mustn't require solving puzzles or remembering passwords without help (3.3.8, AA). And, as you saw in the previous lesson, it removed criterion 4.1.1, Parsing.

The following sections review the key points that depend directly on your HTML and CSS, with the relevant WCAG criterion.

Language of the page and of its parts

  • Language of the page (3.1.1, A): <html lang="en">. The screen reader chooses the voice and pronunciation rules based on this attribute. Without it, a screen reader set to Spanish would read "The Blue Cup" with Spanish pronunciation.
  • Language of parts (3.1.2, AA): passages in another language, with their own lang. At The Blue Cup you applied this in Text Formatting Tags:
<p>Try our <i lang="it">ristretto</i> or, in summer, an <i lang="it">affogato</i>.</p>

There's no need to mark foreign words that have already been absorbed into English (such as "cappuccino" or "croissant"), only those that are pronounced in their original language.

Alt text (review)

Criterion 1.1.1, Non-text Content (A), requires a text alternative for everything that isn't text. You studied it in depth in Adding Images and applied it to SVG and canvas in Graphics in HTML. In short:

Type of image Alternative
Informative An alt that conveys the information: "Golden, flaky croissant on a white plate"
Functional (inside a link or button) An alt that describes the action or the destination: "The Blue Cup home page"
Decorative alt="" (empty, never missing); for inline SVG, aria-hidden="true"
Complex (chart, map) A short description in alt or aria-label + the full data in the text
Audio and video Captions and transcript (Embedding Videos, Using the Audio Element)

Colour contrast

Criterion 1.4.3, Contrast (Minimum) (AA), requires a sufficient contrast ratio between text and its background. The ratio goes from 1:1 (the same colour) to 21:1 (black on white), and it's calculated from the relative luminance of the two colours.

What Minimum contrast (AA) Enhanced contrast (AAA)
Normal text 4.5:1 7:1
Large text: from 24 px, or from 18.66 px in bold (approx. 18 pt and 14 pt) 3:1 4.5:1
User interface components and graphics needed to understand the content: field borders, icons without text, focus indicator, chart bars (1.4.11) 3:1 —
Decorative text, logos, disabled controls No requirement —

Tools for measuring it:

  • Chrome or Edge DevTools: in the Styles panel, click the colour swatch of a color property; the picker shows the contrast ratio with the background and two lines marking the AA and AAA thresholds. You already used it in Styling HTML Elements.
  • WebAIM Contrast Checker (https://webaim.org/resources/contrastchecker/): you enter the two colours in hexadecimal and it tells you whether they meet each level.
  • Colour Contrast Analyser (by TPGi): a free desktop application with an eyedropper for measuring any colour on the screen, even in images.

A practical example: grey #999999 on white has a contrast of 2.85:1 and does not pass for text. Grey #767676 is the lightest that meets 4.5:1 on white (4.54:1). If you want "soft" secondary text, don't go any lighter.

Not relying on colour alone

Criterion 1.4.1, Use of Color (A), requires that colour isn't the only means of conveying information. Roughly one in twelve males and one in two hundred females have some form of colour blindness, and colour is also lost on monochrome screens, in black-and-white printouts or in forced colours mode.

Bad: colour only Good: colour + another cue
Required fields with the label in red Label with an asterisk and a note "Fields marked with * are required"
Links within a paragraph distinguished only by colour Underlined links
The current page in the menu in a different colour Bottom border or bold, as well as aria-current="page"
"Products in green are gluten-free" An "Allergens" column with text
A form error indicated with a red border A text message explaining the error

The Blue Cup already passes: required fields have an asterisk and a note, the current page in the menu has a bottom border, the menu shows allergens in text and links in paragraphs keep their underline.

Keyboard navigation and focus order

Criterion 2.1.1, Keyboard (A), requires that all functionality can be used with the keyboard. The basic keys:

Key Action
Tab Go to the next interactive element (link, button, field)
Shift + Tab Go back to the previous one
Enter Follow a link; press a button; submit a form
Space Press a button; tick a checkbox; scroll the page
Arrow keys Move between radio buttons in the same group; change the option of a select; scroll
Esc Close a modal dialog or a drop-down

The elements that receive focus with Tab are, by default, the interactive ones: a with href, button, input, select, textarea, summary, video and audio with controls, and iframe. A div or a span never receives focus on its own.

The focus order (2.4.3, A) follows the order of the HTML code, not the visual order. Therefore:

  • Write the HTML in the logical reading order.
  • Be careful with CSS that reorders things visually: order in Flexbox, grid-template-areas or explicit placement in Grid, or flex-direction: row-reverse. If the visual order and the code order diverge, the focus "jumps" around confusingly. On The Blue Cup's home page, the Grid areas respect the order of the HTML (welcome, bakery, offer, book, opening hours, reviews), so the focus moves through the page as it is read.
  • A dialog opened with showModal() manages focus for you: it moves it inside, keeps it there while it's open and returns it to the button that opened it when it closes. It's another reason to prefer native elements.

tabindex: 0, -1 and why never positive

The global tabindex attribute changes whether and how an element can receive focus:

Value Effect When to use it
tabindex="0" The element joins the Tab order, in its natural position in the code A non-interactive element that must be able to receive focus with the keyboard, such as the scrollable region of a wide table
tabindex="-1" The element is not in the Tab order, but it can receive focus via JavaScript (element.focus()) or as the target of a link Headings or containers that focus is moved to programmatically, for example after showing a message
tabindex="1" or higher The element moves ahead of all the others in the Tab order Never

Why never positive? Because it creates an order parallel to the document's. If you give the bookings button tabindex="1", the first Tab on the page jumps straight to it, before the menu and everything else; then the focus goes back to the beginning. With several positive values scattered around, the order becomes impossible to maintain. If an element needs to come first, move it in the HTML.

At The Blue Cup you already use tabindex="0" where it's justified: on the div.table-scroll elements from Module 9. A table that scrolls horizontally needs to receive focus so that someone using the keyboard can scroll it with the arrow keys.

Visible focus

Criterion 2.4.7, Focus Visible (AA), requires that you can always see which element has focus. If someone navigates with the keyboard and can't see the focus, it's like using a mouse with an invisible pointer.

  • Never write outline: none (or outline: 0) without replacing it with another equally clear indicator. It's one of the most widespread accessibility mistakes.
  • Use :focus-visible, which shows the indicator when navigating with the keyboard but not when clicking with the mouse. It's what The Blue Cup has had since Basic CSS Selectors:
:focus-visible {
  outline: 3px solid var(--color-brand);
  outline-offset: 2px;
}
  • The indicator must contrast with its surroundings (3:1 against adjacent colours). That's why, in the footer, with its blue background, the outline turns white.
  • The focused element mustn't be obscured by sticky headers or banners (2.4.11, new in WCAG 2.2). The Blue Cup's header isn't sticky, so there's no risk.

The "Skip to content" link

Imagine you're navigating with the keyboard. Every time you open a page of The Blue Cup, before you reach the content you have to press Tab seven times: the logo and the six menu links. On a site with a bigger menu, that could be twenty or thirty presses on every page. Criterion 2.4.1, Bypass Blocks (A), requires a mechanism to skip repeated content.

The classic solution is a skip link: the first focusable element on the page, which takes you straight to the main content. In main and figure you prepared its target, <main id="content">.

  <body>
    <a class="skip-link" href="#content">Skip to content</a>
    <header>
      …
    </header>
    <main id="content">
      …
    </main>
  • It's an ordinary link to an anchor, like the ones you created in Special Links: it doesn't need JavaScript.
  • It goes before the header, as the first child of the body, so that it's the first thing Tab reaches.
  • When it's activated, the browser scrolls to the main and moves the focus starting point there: the next Tab goes to the first interactive element in the content, not to the menu.

Doesn't it get in the way visually? The usual technique is to hide it until it receives focus. People who use the mouse never see it; people who use the keyboard see it appear when they press Tab for the first time:

/* "Skip to content" link: hidden until it receives focus */
.skip-link {
  position: absolute;
  top: 0.5rem;
  left: 0.5rem;
  z-index: 10;
  padding: 0.75rem 1rem;
  font-weight: bold;
  border-radius: var(--radius);
  transform: translateY(-200%);
}

.skip-link,
.skip-link:visited,
.skip-link:hover {
  background-color: var(--color-brand);
  color: var(--color-white);
}

.skip-link:focus {
  transform: none;
}

Line by line:

  • position: absolute takes the link out of the flow: it doesn't push the header down. top and left place it in the top left-hand corner of the page.
  • z-index: 10 puts it above the header when it appears.
  • transform: translateY(-200%) moves it upwards by twice its own height: it ends up off screen, but it still exists, it's still focusable and screen readers announce it.
  • The second block also sets the colours for :visited and :hover. Without it, the general a:visited rule (specificity 0,1,1) would beat .skip-link (0,1,0) and the text would turn purple on blue; and a:hover would give it the cream background with white text. With .skip-link:visited and .skip-link:hover (0,2,0), the link always keeps its contrast of 8.66:1.
  • .skip-link:focus cancels the offset when it receives focus: the link appears in place. :focus is used rather than :focus-visible so that it appears whenever it has focus, however you got there.

Why not display: none or visibility: hidden? Because those values remove the element from keyboard navigation and from the accessibility tree: it could never receive focus. hidden isn't suitable either, for the same reason.

If you wanted to animate its appearance with a transition, you'd have to disable it with prefers-reduced-motion, as you'll see further down. At The Blue Cup it appears without animation.

Is tabindex="-1" needed on the main? Years ago, some browsers didn't move focus to the target of an anchor, and tabindex="-1" was added to the target to force it. Current browsers already get this right. What's more, adding it can show a focus outline around the whole main when you click. At The Blue Cup we don't use it; if, in your tests, a particular browser didn't move the focus, it would be the solution.

Accessible forms (review)

Forms are probably the part of the site where accessibility matters most, because that's where people do something. You studied this in Labels and Grouping and in Form Attributes and Validation. In short:

  • Every field with its label associated through for/id (1.3.1 and 4.1.2). The placeholder is not a label.
  • Groups of radio buttons and checkboxes in a fieldset with a legend.
  • Required fields indicated with text (the asterisk and its note) and with required.
  • autocomplete with the appropriate value on personal data (1.3.5, AA): it allows them to be filled in automatically and helps people with motor or cognitive difficulties.
  • Error messages in text and close to the field (3.3.1, A). Native validation messages cover the basics.
  • Instructions and hints associated with the field so that the screen reader reads them when it reaches it: you'll do this with aria-describedby in the next lesson, the task left pending in Module 5.

Motion and prefers-reduced-motion

Motion can cause dizziness, nausea or distraction for some people, for example people with vestibular disorders or ADHD. WCAG requires:

  • That any content that moves, blinks or scrolls by itself for more than five seconds can be paused, stopped or hidden (2.2.2, A). That's why the gallery video has controls and doesn't play by itself.
  • That nothing flashes more than three times per second (2.3.1, A): it can trigger epileptic seizures.
  • That animations triggered by interaction can be disabled (2.3.3, AAA).

In Media Queries you met the prefers-reduced-motion query, which detects whether the person has asked their system to reduce motion. The rule of thumb: every animation or transition you add must be disabled or toned down inside @media (prefers-reduced-motion: reduce). The Blue Cup has no animations, so you don't need to add anything.

Project: skip link and contrast review

  1. The "Skip to content" link (the seven pages and the template)

In index.html, menu.html, bookings.html, gallery.html, news.html, contact.html, privacy.html and also in template.html, add the link as the first child of the body:

  <body>
    <a class="skip-link" href="#content">Skip to content</a>
    <header>
      <!-- logo and menu -->
    </header>

    <main id="content">

Check on every page that the main has id="content" (in index.html, <main id="content" class="home">).

  1. The link's CSS (css/styles.css)

Add the three rules from the section "The 'Skip to content' link" at the end of section 2, Base, right after the :focus-visible rule. It's an accessibility component shared by every page, so its natural place is the base of the stylesheet.

Test it with Live Server:

  1. Open menu.html and click in the browser's address bar.
  2. Press Tab: the blue "Skip to content" box appears in the top left-hand corner.
  3. Press Enter: the page scrolls to the h1 "Our menu".
  4. Press Tab again: the focus goes to the first link in the content (the "On this page" index), not to the logo.
  5. Repeat the test on the simulated phone in DevTools and on the home page.

  1. Reviewing the palette's contrast

Use DevTools or the WebAIM Contrast Checker to measure every colour combination the stylesheet uses. These are the results for The Blue Cup's palette:

Text or element Background Contrast Use Passes AA?
--color-text #222222 White 15.91:1 General text Yes
--color-text #222222 --color-cream #fff6e0 14.78:1 Text in the price cells Yes
--color-brand #1f4e79 White 8.66:1 Headings, links, secondary buttons, focus Yes
White --color-brand #1f4e79 8.66:1 Footer, primary buttons, skip link Yes
--color-brand #1f4e79 --color-cream #fff6e0 8.05:1 Links on hover Yes
--color-brand #1f4e79 --color-soft #dce6f0 6.86:1 Category rows in the menu Yes
--color-visited #5b3f86 White 8.40:1 Visited links Yes
--color-text-muted #555555 White 7.46:1 Form hints, figcaption Yes
--color-text-muted #555555 --color-light-grey #f7f7f7 6.96:1 Table footers Yes
--color-text-muted #555555 (border) White 7.46:1 Field borders (component, 3:1) Yes
--color-border #c8d3e0 (border) White 1.52:1 Table cell borders Not applicable: decorative (the table can be understood without them)
Placeholder text (placeholder) White Depends on the browser "600 000 000" in the phone field Review

Conclusions:

  • The palette comfortably meets level AA, and even AAA (7:1) in almost every text combination.
  • --color-border doesn't reach 3:1, but it's only used to separate cells, which is decorative. It must never be used for the border of a field or for a meaningful icon. You already noted this in Styling HTML Elements.
  • The placeholder text in the phone field uses the browser's default grey, which is usually light and, in some browsers, also semi-transparent. Although the placeholder doesn't replace the label, if text is shown, it must be readable. Set it in section 8, Forms and buttons:
::placeholder {
  color: var(--color-text-muted);
  opacity: 1;
}
  • ::placeholder is a pseudo-element that selects the placeholder text of any field.
  • opacity: 1 cancels the transparency that some browsers (such as Firefox) apply to that text, which would reduce the effective contrast.
  • With #555555, the contrast is 7.46:1. Placeholder text and typed text can still be told apart because typed text is #222222, almost black; if you wanted more difference, don't lighten the grey: change the style instead, for example with italics.

  1. A quick review of the remaining key points

Go through the list and check that The Blue Cup already meets them:

Point Criterion Status
lang="en" on all seven pages; foreign terms with lang 3.1.1, 3.1.2 Met since Modules 1 and 2
Alt text on every image; decorative SVG hidden; canvas with an alternative 1.1.1 Met
Video subtitles and interview transcript 1.2.2, 1.2.1 Met
Text and component contrast 1.4.3, 1.4.11 Met after setting the placeholder
Information not conveyed by colour alone 1.4.1 Met
Everything operable with the keyboard; table regions with tabindex="0" 2.1.1 Met (you'll check it thoroughly in Accessibility Testing)
No positive tabindex 2.4.3 Met
Visible focus, in the footer too 2.4.7 Met
Mechanism for bypassing blocks 2.4.1 Met from this lesson
Unrestricted zoom; no horizontal scrolling at 320 px 1.4.4, 1.4.10 Met since Module 9
Form hints associated with their fields 1.3.1 Pending: next lesson
Gluten-free filter message announced when it changes 4.1.3 Pending: next lesson

Common Mistakes and Tips

  • outline: none to get rid of "that ugly border": it removes the focus for people navigating with the keyboard. If you don't like how it looks, change it; never remove it.
  • Hiding the skip link with display: none: it's no longer focusable and loses all its usefulness. Use the technique of moving it off screen.
  • Putting the skip link after the menu: it has to be the first focusable element.
  • Positive tabindex values to "fix" the order: the right fix is to reorder the HTML.
  • Judging contrast by eye: perception is deceptive, even more so on a good screen. Always use a tool.
  • Thinking that accessibility is only for blind people: most improvements benefit far more people, with permanent, temporary or situational limitations.
  • Leaving accessibility until the end: it costs much more. Apply it from the first line, as you have in this course.
  • Tip: unplug the mouse (or don't touch it) for five minutes and browse your site using only the keyboard. It's the cheapest and most revealing accessibility test there is.

Exercises

Exercise 1. For each situation, state the POUR principle involved and the WCAG criterion that is broken (by its approximate name):

a) A drop-down menu that only opens when you hover over it with the mouse. b) A form that shows errors only by colouring the field's border red. c) A page in Catalan with <html lang="en">. d) A "Buy" button with #aaaaaa text on white. e) A video with dialogue and no subtitles.

Exercise 2. This CSS has three accessibility problems. Find them and fix them.

a:focus {
  outline: none;
}

.skip-link {
  display: none;
}

.skip-link:focus {
  display: block;
}

.help {
  color: #b0b0b0;
}

Exercise 3. On a page, the menu code is as follows. Describe the order in which the elements are visited with Tab and explain why it's a problem. Suggest the fix.

<nav aria-label="Main menu">
  <ul class="menu">
    <li><a href="index.html">Home</a></li>
    <li><a href="menu.html" tabindex="2">Menu</a></li>
    <li><a href="bookings.html" tabindex="1">Bookings</a></li>
    <li><a href="contact.html">Contact</a></li>
  </ul>
</nav>

Solutions

Solution 1.

a) Operable: Keyboard (2.1.1). You can't "hover" with the keyboard; the menu should also open when it receives focus or, better, with a button. b) Perceivable: Use of Color (1.4.1); and also Understandable: Error Identification (3.3.1), which requires the error to be described in text. c) Understandable: Language of Page (3.1.1). The screen reader would read the Catalan with English rules. d) Perceivable: Contrast (Minimum) (1.4.3). #aaaaaa on white has a contrast of about 2.3:1, well below 4.5:1. e) Perceivable: Captions (Prerecorded) (1.2.2).

Solution 2.

  1. a:focus { outline: none; } removes the visible focus from links. Delete the rule and rely on the project's general :focus-visible rule.
  2. .skip-link { display: none; } stops the skip link from receiving focus: the :focus rule never gets applied, because an element with display: none can't be focused. Replace it with the offset technique:
.skip-link {
  position: absolute;
  top: 0.5rem;
  left: 0.5rem;
  transform: translateY(-200%);
}

.skip-link:focus {
  transform: none;
}
  1. #b0b0b0 on white has a contrast of about 2.1:1: the hint text is illegible for many people. Use the project's grey:
.help {
  color: var(--color-text-muted); /* #555555: 7.46:1 on white */
}

Solution 3. Order with Tab: first Bookings (tabindex="1"), then Menu (tabindex="2"), and only then the rest of the page in code order: Home, Contact and everything else. It's a problem because the focus jumps around confusingly, doesn't match the visual order and forces keyboard users to guess where it is. Furthermore, if those values aren't repeated on another page, the behaviour changes from one page to the next. The fix is to remove both tabindex attributes. If you want "Bookings" to come first, move it in the HTML (and, with it, visually as well).

Conclusion

Web accessibility means that anyone can perceive, understand, navigate and interact with a site, and it benefits many more people than it might seem: people with a permanent disability, but also a temporary or situational one. You know, broadly, the European and Spanish legal framework (with the caveat of consulting a professional for each case) and the reference technical standard, WCAG 2.2, with its four POUR principles and its levels A, AA and AAA, AA being the goal. You've reviewed the key points that depend on your HTML and CSS: language, alt text, contrast of 4.5:1 and 3:1 and how to measure it, not relying on colour alone, focus order, the correct use of tabindex (0 and -1, never positive), visible focus, forms and motion. The Blue Cup now has a "Skip to content" link on all its pages and in the template, and a reviewed palette with a readable placeholder. Two tasks remain that native HTML can't solve on its own: associating the booking form's hints with their fields, and getting the screen reader to announce the result of the gluten-free filter the moment it changes. That's what ARIA is for. In the next lesson, Using ARIA Roles and Attributes, you'll learn what it is, when to use it and, above all, when not to.

HTML Course

Module 1: Introduction to HTML

Module 2: Text Formatting in HTML

Module 3: Links and Media in HTML

Module 4: Tables in HTML

Module 5: Forms in HTML

Module 6: HTML5 Semantic Elements

Module 7: Advanced HTML Techniques

Module 8: Integrating HTML and CSS

Module 9: Responsive Web Design

Module 10: Best Practices and Accessibility

Module 11: Project: Building a Complete Website

© Copyright 2026. All rights reserved