At the end of the previous lesson, two tasks were left pending at The Blue Cup that native HTML can't solve on its own. In the booking form, the hint texts ("9-digit Spanish phone number…", "From 8:00 to 19:00…") sit just below each field, but a screen reader jumping from field to field with Tab doesn't read them: it announces the label and the type of field, and the hint goes unheard. On the menu page, when you tick "Show gluten-free products only", the result paragraph changes to "Showing 9 gluten-free products.", but someone who can't see the screen doesn't find out that anything has changed. ARIA exists for cases like these: a set of attributes that lets you complete the information the browser passes on to assistive technologies. It's a powerful tool, and that's precisely why it's dangerous: used badly, it makes accessibility worse instead of better. In this lesson you'll learn what ARIA is and its golden rule, what roles are and which ones semantic elements already have, the most useful states and properties, and you'll apply them to The Blue Cup, also reviewing the uses of ARIA it already has.
Contents
- What ARIA is and how it works
- The first rule of ARIA: don't use it if there's a native element
- The five rules of ARIA use
- Roles: landmark, structure and widget
- Implicit roles of semantic elements
- Accessible names:
aria-labelandaria-labelledby - Descriptions:
aria-describedby - Hiding from assistive technologies:
aria-hidden - States:
aria-expanded,aria-current,aria-invalidandaria-required - Live regions:
aria-live - The anti-pattern:
div role="button"versusbutton - Project: reviewing and completing ARIA at The Blue Cup
What ARIA is and how it works
WAI-ARIA (Accessible Rich Internet Applications) is a W3C specification that defines attributes to tell assistive technologies what an element is, what it's called and what state it's in, when HTML isn't enough to say so.
To understand it, you need to know about the accessibility tree. From the DOM, the browser builds a simplified version for assistive technologies, in which each node has, among other things:
- A role: what it is. "Button", "link", "heading level 2", "checkbox".
- A name: what it's called. The button text, the image's
alt, the field'slabel. - A description: additional information, read after the name.
- Some states and properties: whether a checkbox is ticked, whether a drop-down is open, whether a field is required.
graph LR
A["HTML<br/>(DOM)"] --> B["Accessibility tree<br/>role · name · description · state"]
B --> C["Operating system<br/>accessibility API"]
C --> D["Screen reader,<br/>voice control, braille…"]
E["ARIA attributes"] -.->|"modify"| B
You already explored it in Accessible Tables, with the DevTools accessibility pane. The key is this: ARIA only changes the accessibility tree. It doesn't change appearance or behaviour. A div with role="button" is announced as a button, but it does not receive focus with Tab, it is not activated with Enter or Space and it does not submit forms. ARIA makes promises; you have to program the behaviour yourself.
The first rule of ARIA: don't use it if there's a native element
The W3C's own guide on using ARIA states it clearly: if you can use a native HTML element or attribute with the semantics and behaviour you need, use it instead of repurposing another element with ARIA. And a saying often repeated in the accessibility world sums it up: "no ARIA is better than bad ARIA". Annual analyses of large samples of web pages, such as the WebAIM Million report, consistently find that pages with ARIA have, on average, more detected accessibility errors than pages without it. Not because ARIA is bad, but because it's used to paper over poorly chosen HTML.
| Instead of… | Use |
|---|---|
<div role="button"> |
<button> |
<span role="link"> |
<a href="…"> |
<div role="navigation"> |
<nav> |
<div role="heading" aria-level="2"> |
<h2> |
<div role="checkbox" aria-checked="false"> |
<input type="checkbox"> |
<div role="dialog"> |
<dialog> |
<input aria-required="true"> |
<input required> |
ARIA makes sense in three situations:
- When HTML doesn't have an element or attribute for what you need: naming a region, associating a hint text with a field, announcing a change on the page.
- When you build a component that HTML doesn't offer (tabs, application menus, tree views), which you won't do in this course.
- To correct specific situations, such as hiding a decorative icon.
The five rules of ARIA use
The W3C guide Using ARIA sets out five rules. It's worth keeping them in mind at all times:
| Rule | In a nutshell |
|---|---|
| 1 | If there's a native HTML element with the semantics and behaviour you need, use it |
| 2 | Don't change native semantics unless you really have to: don't put role="button" on an h2; put the button inside the heading |
| 3 | All interactive ARIA controls must be usable with the keyboard |
| 4 | Don't use role="presentation" or aria-hidden="true" on an element that can receive focus |
| 5 | All interactive elements must have an accessible name |
Roles: landmark, structure and widget
The role attribute declares what an element is. Roles are grouped into categories. The three you'll come across most:
| Category | What they're for | Example roles |
|---|---|---|
| Landmark | Marking the main regions of the page; screen readers let you jump from one to another | banner, navigation, main, complementary, contentinfo, search, form, region |
| Document structure | Describing how the content is organised, non-interactive | heading, list, listitem, table, row, cell, img, figure, article, separator, presentation/none |
| Widget (interactive components) | Describing controls you interact with | button, link, checkbox, radio, textbox, combobox, slider, tab, tabpanel, dialog, menu |
There are also live region roles (status, alert, log, timer), which you'll see in the section on aria-live, and abstract roles that only the specification uses internally.
In Introduction to Semantic HTML you saw that structural elements create landmarks that screen readers use to jump around. In Accessibility Testing you'll check how to navigate through them.
Implicit roles of semantic elements
Almost all HTML elements already have an implicit role: the one the browser assigns them in the accessibility tree without you writing anything. That's why semantic HTML is the best way to "use ARIA".
| Element | Implicit role | Notes |
|---|---|---|
header |
banner |
Only the page's; inside article, aside, main, nav or section it isn't a landmark |
nav |
navigation |
|
main |
main |
|
aside |
complementary |
|
footer |
contentinfo |
Only the page's, with the same condition as header |
search |
search |
|
section |
region |
Only if it has an accessible name (aria-label or aria-labelledby) |
form |
form |
Only if it has an accessible name |
article |
article |
|
h1 to h6 |
heading |
With level 1 to 6 |
ul, ol |
list |
|
li |
listitem |
|
table, tr, th, td |
table, row, columnheader/rowheader, cell |
|
a with href |
link |
Without href, it isn't a link |
button |
button |
|
img with non-empty alt |
img |
|
img with alt="" |
presentation |
It's ignored |
input type="checkbox" |
checkbox |
|
input type="radio" |
radio |
|
input type="text", email, tel… |
textbox |
With list (a datalist), combobox |
input type="search" |
searchbox |
|
input type="number" |
spinbutton |
|
select |
combobox |
listbox if it has multiple or a size greater than 1 |
textarea |
textbox |
Multi-line |
dialog |
dialog |
|
details |
group |
The summary behaves like a disclosure button |
figure |
figure |
|
hr |
separator |
The practical consequence: don't repeat the implicit role. Writing <nav role="navigation"> or <main role="main"> adds nothing, and the validator will warn you: The “navigation” role is unnecessary for element “nav”. It was a technique from years ago, when some browsers didn't recognise the new HTML5 elements.
Accessible names: aria-label and aria-labelledby
Every interactive element and every landmark needs an accessible name. It normally comes from the HTML: the text of the link or button, the alt, the label, the caption, the legend. When there's no text that can serve as a name, or there are several elements of the same type to tell apart, two attributes are used:
| Attribute | What it does | When to use it |
|---|---|---|
aria-label="text" |
Uses the text written in the attribute as the name | When there's no visible text that can serve as a name |
aria-labelledby="id" |
Uses the text of the element (or elements) with that id as the name |
When there's already visible text, such as a heading |
<!-- aria-label: there's no visible text that can serve as a name -->
<nav aria-label="Main menu">…</nav>
<!-- aria-labelledby: the name is the visible heading -->
<section aria-labelledby="workshops-title">
<h2 id="workshops-title">Workshops</h2>
…
</section>Important rules:
aria-labelledbytakes priority overaria-label, and both replace the name that would come from the content. If you putaria-label="More"on a button with the text "See booking conditions", the screen reader will say "More": the visible text and the accessible name no longer match. This also harms people who use voice control and say "click See conditions".- Prefer
aria-labelledbytoaria-labelwhen the text exists: visible text is translated by the browser's translation tool; the content ofaria-labelisn't always. - Don't put
aria-labelon elements without a role that supports it, such as a genericdivorspanor ap: it's ignored or behaves unpredictably. - Don't include the role in the name:
aria-label="Main menu", not"Main menu navigation"; the screen reader already says "navigation".
Descriptions: aria-describedby
The name says what an element is; the description adds supplementary information, which the screen reader reads after the name, the role and the state. The aria-describedby attribute points to the id (or several, separated by spaces) of the text that serves as the description:
<label for="phone">Phone *</label>
<input type="tel" id="phone" name="phone" required aria-describedby="help-phone">
<small id="help-phone">9-digit Spanish phone number, with or without +34 and with or without spaces.</small>When it reaches the field with Tab, a screen reader will announce something like: "Phone star, edit text, required. 9-digit Spanish phone number, with or without +34 and with or without spaces". Without aria-describedby, the hint would only be heard if the person went through the text line by line.
You already used it in Accessible Tables: the lunch menu table has aria-describedby="lunch-description", which points to the paragraph explaining how the menu works.
Some details:
- The description is read as plain text: if it contains a link, the text is read, but it isn't announced as a link.
- The referenced element can be hidden (with
hidden) and still serve as a description; but if the information is useful to everyone, it's better for it to be visible. - Descriptions should be short: they're read every time the field receives focus.
Hiding from assistive technologies: aria-hidden
aria-hidden="true" removes an element and all its content from the accessibility tree, even though it's still visible on screen. It's for decorative or redundant elements:
<footer>
<p>
<svg width="24" height="24" viewBox="0 0 64 64" aria-hidden="true" focusable="false">…</svg>
<strong>The Blue Cup</strong>, café and bakery
</p>It's what you did with the cup icon in Graphics in HTML: SVG and canvas. The focusable="false" attribute is a precaution for an old browser (Internet Explorer), which made SVGs focusable; today it isn't needed, but it does no harm.
Be careful with aria-hidden:
- Never on a focusable element (rule 4): if a link has
aria-hidden="true", you can reach it withTab, but the screen reader says nothing. It's a "hole" in the page. - Don't use it to hide content from everyone: that's what
hidden(ordisplay: none) is for, which hides it from both the screen and the accessibility tree at once.
| Technique | Is it visible? | Does the screen reader announce it? | Use |
|---|---|---|---|
hidden or display: none |
No | No | Hiding from everyone (filtered menu rows) |
aria-hidden="true" |
Yes | No | Decoration or duplicates (cup icon) |
| Moved off screen | No (until it receives focus) | Yes | "Skip to content" link |
States: aria-expanded, aria-current, aria-invalid and aria-required
States are ARIA attributes whose value changes with interaction, and which the screen reader announces.
aria-current
Indicates the current element within a set. You've been using it since header, nav and footer to mark the current page in the menu:
The screen reader announces "Menu, link, current page". It accepts other values (step in a multi-step process, date in a calendar, location, true), but in a menu you use page. Notice that The Blue Cup also uses it for styling, with the selector .menu a[aria-current="page"]: that way the visual appearance and the accessible information can never get out of sync.
aria-expanded
Indicates whether an element that controls a collapsible area has it open (true) or closed (false). The typical example is a mobile menu button:
<button type="button" aria-expanded="false" aria-controls="mobile-menu">Menu</button>
<ul id="mobile-menu" hidden>…</ul>A script would change aria-expanded to true and remove hidden when the button is pressed. The Blue Cup doesn't need it: its menu stacks on mobile without being hidden, and its collapsible sections are details/summary, which already communicate "collapsed" or "expanded" natively. It's another advantage of native elements.
aria-invalid
Indicates that a field's value is not valid. Screen readers announce "invalid" or "invalid entry". The native HTML validation you studied in Form Attributes and Validation doesn't set it by itself; it's used when validation is done with JavaScript and custom messages are shown, together with aria-describedby pointing to the error message:
<input type="email" id="email" name="email" aria-invalid="true" aria-describedby="email-error">
<p id="email-error">Enter an email address in the format [email protected].</p>The important thing: aria-invalid must be set only when there's an error (and removed once it's corrected), never from the start on an empty field. The Blue Cup uses native validation, so it doesn't need it for now.
aria-required
Indicates that a field is required. But on native fields you already have required, which also prevents submission and is announced in the same way. aria-required="true" only makes sense on widgets built with ARIA. At The Blue Cup, required is enough.
Live regions: aria-live
When part of the page changes without the person moving the focus (a confirmation message, a counter, the result of a filter), the screen reader doesn't notice: it only reads what's where the focus is. A live region is an element whose changes are announced automatically.
| Value | Behaviour | Use |
|---|---|---|
aria-live="polite" |
Announces the change when the screen reader finishes what it's saying | Almost always: confirmations, results, counters |
aria-live="assertive" |
Interrupts whatever is being read to announce the change | Only for urgent things: a serious error, a session about to expire |
aria-live="off" |
Doesn't announce (default value) |
Some roles carry an implicit live region:
role="status"is equivalent toaria-live="polite"(plusaria-atomic="true", which makes the whole content be read and not just the changed part). It's a perfectly valid alternative for the filter message.role="alert"is equivalent toaria-live="assertive".
Two rules for them to work:
- The region must exist on the page before the change. If the script creates the paragraph and sets its text at the same time, many screen readers don't announce it. That's why the
#filter-resultparagraph is in the HTML from the start, empty. - Don't overdo it: if everything is announced, nothing is understood. Only the messages the person needs to know about.
The anti-pattern: div role="button" versus button
Let's look at what the first rule of ARIA means in practice. This is a "button" made with a div, as seen on many sites:
Problems: it isn't announced as a button, it doesn't receive focus with Tab and it can't be activated with the keyboard. To bring it up to the level of a button, you need all of this:
<div class="btn" role="button" tabindex="0" id="see-conditions">See conditions</div>
<script>
const fakeButton = document.getElementById("see-conditions");
fakeButton.addEventListener("click", openConditions);
fakeButton.addEventListener("keydown", (event) => {
if (event.key === "Enter" || event.key === " ") {
event.preventDefault();
openConditions();
}
});
</script>role="button": so that it's announced as a button.tabindex="0": so that it receives focus withTab.- The
keydownevent: so that it responds toEnterandSpace, like a real button.event.preventDefault()stopsSpacefrom scrolling the page. - CSS for focus: a
divdoesn't have default focus styles in every browser.
And even then it would lack the disabled state (disabled), form submission and compatibility with some system modes. Compare it with:
One line, no ARIA, and everything works. It's exactly what you did in the bookings dialog in Other Semantic Elements.
div role="button" |
button |
|
|---|---|---|
| Announced as a button | With role |
Yes |
Receives focus with Tab |
With tabindex="0" |
Yes |
Activated with Enter and Space |
By programming it | Yes |
| Can be disabled | By programming it (aria-disabled + logic) |
disabled |
| Submits forms | No | Yes, if it's type="submit" |
| Lines of code | Many | One |
Project: reviewing and completing ARIA at The Blue Cup
- Reviewing the existing uses of ARIA
Search the whole project (Ctrl + Shift + F in VS Code) for the strings aria- and role=. These are the uses you should find, and their assessment:
| Where | Code | Is it correct? |
|---|---|---|
| All seven pages, menu | <nav aria-label="Main menu"> |
Yes: there's no visible text naming the navigation, and it prepares the site for a second nav (such as a page index) without ambiguity |
| All seven pages, menu | aria-current="page" on the current page's link |
Yes: check that it's on only one link per page, and the right one |
index.html, menu.html |
div.table-scroll with tabindex="0", role="region" and aria-label |
Yes: a focusable div needs a role and a name (rule 5); as a region, it also appears in the list of landmarks |
menu.html, lunch menu |
<table aria-describedby="lunch-description"> |
Yes: it associates the explanation of the menu with the table |
| All seven pages, footer | Cup SVG with aria-hidden="true" and focusable="false" |
Yes: decorative, next to the written name |
news.html, chart |
<canvas role="img" aria-label="Bar chart: …"> |
Yes: canvas has no useful role of its own; besides, the data is in the visible list |
A note on the table regions: since they already have an aria-label with the same text as their table's caption ("Price list", "Weekly opening hours by service"), the screen reader announces the name twice on entering: once for the region and once for the table. That's acceptable and common in this pattern. There's nothing to change.
No use breaks the five rules: there are no redundant roles, no aria-hidden on focusable elements and no ARIA where HTML was enough.
- Associating the booking form hints (
bookings.html)
bookings.html)This was the task pending since Form Attributes and Validation. Give each hint text an id and link it from its field with aria-describedby:
<p>
<label for="phone">Phone *</label>
<input type="tel" id="phone" name="phone" required
pattern="(\+34 ?)?[6-9]( ?[0-9]){8}"
title="9-digit Spanish phone number, with or without +34"
placeholder="600 000 000" autocomplete="tel"
aria-describedby="help-phone">
<small id="help-phone">9-digit Spanish phone number, with or without +34 and with or without spaces.</small>
</p> <p>
<label for="time">Time *</label>
<input type="time" id="time" name="time" required min="08:00" max="19:00" step="1800"
aria-describedby="help-time">
<small id="help-time">From 8:00 to 19:00, on the hour or half past.</small>
</p>
<p>
<label for="guests">Number of guests *</label>
<input type="number" id="guests" name="guests" required min="1" max="12" step="1" value="2"
aria-describedby="help-guests">
<small id="help-guests">Up to 12 people. For larger groups, call us on <a href="tel:+34900000000">+34 900 000 000</a>.</small>
</p> <p>
<label for="comments">Comments (allergies, highchairs…)</label>
<textarea id="comments" name="comments" rows="4" cols="40" maxlength="500"
aria-describedby="help-comments"></textarea>
<small id="help-comments">500 characters maximum. If you tell us about any allergies or intolerances, we will only use that information to prepare for your visit.</small>
</p>- The
idvalues follow the project convention: lowercase, hyphens and a prefix that explains their function (help-). - On the phone field, the
titlestays: it's the text the browser shows in thepatternerror message. Some screen readers also read it as a description if there's noaria-describedby; with it, the full hint is read. - On the number of guests, the description includes a link: the screen reader will read its text ("+34 900 000 000") as part of the description, but not as a link. The link is still reachable with
Tab, right after the field. - The date field has no hint text, so it doesn't get
aria-describedby.
Also check news.html and contact.html for hint texts next to any field. The basic data protection information paragraphs aren't hints for a particular field, but for the whole form: they aren't associated.
- Announcing the gluten-free filter result (
menu.html)
menu.html)Add aria-live="polite" to the result paragraph:
<p>
<input type="checkbox" id="gluten-free-filter">
<label for="gluten-free-filter">Show gluten-free products only</label>
</p>
<p id="filter-result" aria-live="polite"></p>The script doesn't change: it already writes the message with textContent. Now, when you tick the checkbox, a screen reader first announces "checked" (the change of state of the checkbox) and then "Showing 9 gluten-free products." When you untick it, the script empties the paragraph and nothing is announced; the person hears "not checked", which is enough.
role="status"would have been just as correct. We chosearia-live="polite"because it makes what happens explicit when you read the code.
- Naming the conditions dialog (
bookings.html)
bookings.html)A dialog is an interactive component and, like every component, it needs an accessible name (rule 5). The dialog doesn't take its name from the heading automatically: when it opens, some screen readers announce it simply as "dialog". As there's already a visible heading, use aria-labelledby:
<dialog id="conditions" aria-labelledby="conditions-title">
<h2 id="conditions-title">Booking conditions</h2>
<ul>
<li>We hold your table for 15 minutes.</li>
<li>If you can't come, let us know by phone or email.</li>
<li>The bread-making workshop has a maximum of 15 places.</li>
</ul>
<form method="dialog">
<button>Got it</button>
</form>
</dialog>Now, when it opens, the screen reader announces "Booking conditions, dialog".
- Checking it in the accessibility tree
- Open
bookings.htmlwith Live Server and DevTools > Elements. - Select the phone field and open the Accessibility tab (in Chrome, in the side pane next to Styles).
- Under Computed Properties, you'll see Name: "Phone *" (from the
label) and Description: the hint text (fromaria-describedby). - Open the dialog and select the
dialogelement: its name is "Booking conditions". - In
menu.html, select#filter-result: the properties show Live region: polite.
Add to the checklist:
- [ ] ARIA only where HTML isn't enough; no redundant roles.
- [ ] No
aria-hiddenon focusable elements. - [ ] Field hints associated with
aria-describedby. - [ ] Messages that change without moving focus, in a live region.
Common Mistakes and Tips
- Using ARIA for everything:
role="button"on adiv,role="navigation"on anav… HTML is the first resort; ARIA is the last. - Believing that ARIA adds behaviour:
role="button"doesn't make the element pressable with the keyboard. You have to program it, and it's easier to usebutton. - An
aria-labelthat contradicts the visible text: it confuses screen reader users and voice control users. If there's visible text, it should be (or start with) the accessible name. aria-hidden="true"on a container with links or buttons: it creates elements that receive focus but aren't announced.- Creating the live region at the same time as the message: it must exist beforehand, empty.
aria-live="assertive"for any message: it interrupts constantly. Usepoliteexcept for emergencies.aria-labelledbyoraria-describedbypointing to anidthat doesn't exist: the attribute does nothing and nobody notices. Check the result in the accessibility pane.- Tip: every time you're about to write
role=oraria-, first ask yourself: "Is there an HTML element or attribute that does this?". The answer is almost always yes.
Exercises
Exercise 1. Review this fragment and state which ARIA attributes are unnecessary, which are incorrect and why. Write the corrected version.
<header role="banner">
<nav role="navigation" aria-label="Main site navigation">
<ul>
<li><a href="index.html" aria-current="true" aria-label="Go to the home page">Home</a></li>
<li><a href="menu.html">Menu</a></li>
</ul>
</nav>
</header>
<main role="main">
<h1>Welcome</h1>
<a href="bookings.html" aria-hidden="true">Book your table</a>
</main>Exercise 2. On the contact page, after it's submitted (with JavaScript, without reloading the page), the form shows the message "Thank you, we'll reply within 48 hours". Write the HTML for the message container so that a screen reader announces it, and explain why it must be in the HTML from the start.
Exercise 3. This field has a hint and an error message that appears when the value isn't valid (handled with JavaScript). Write how the HTML should look in its normal state and in its error state, using aria-describedby and aria-invalid.
<label for="code">Booking code</label>
<input type="text" id="code" name="code">
<small>Format: BC- followed by 4 digits, for example BC-0427.</small>
<p class="error" hidden>The code isn't in the correct format.</p>Solutions
Solution 1.
role="banner",role="navigation"androle="main"are unnecessary: they repeat the implicit role ofheader,navandmain.aria-label="Main site navigation"repeats the role ("navigation"): "Main menu" is enough.aria-current="true"is valid, but in a menu of pages the appropriate value ispage.aria-label="Go to the home page"replaces the visible name "Home" with a different one: it's unnecessary.aria-hidden="true"on a link is incorrect and serious (rule 4): the link receives focus, but the screen reader doesn't announce it.
<header>
<nav aria-label="Main menu">
<ul>
<li><a href="index.html" aria-current="page">Home</a></li>
<li><a href="menu.html">Menu</a></li>
</ul>
</nav>
</header>
<main>
<h1>Welcome</h1>
<a href="bookings.html">Book your table</a>
</main>Solution 2.
or, equivalently, <p id="submit-message" aria-live="polite"></p>. The script will write the text with textContent after submission. It must be in the HTML from the start, empty, because screen readers register live regions when the page loads (or when they appear) and announce subsequent changes to their content; if the region and the text appear at the same time, many screen readers don't announce it. polite is used because it's a confirmation, not an emergency.
Solution 3. Normal state:
<label for="code">Booking code</label>
<input type="text" id="code" name="code" aria-describedby="help-code">
<small id="help-code">Format: BC- followed by 4 digits, for example BC-0427.</small>
<p class="error" id="code-error" hidden>The code isn't in the correct format.</p>Error state (the script makes these changes):
<input type="text" id="code" name="code" aria-invalid="true" aria-describedby="code-error help-code">
<p class="error" id="code-error">The code isn't in the correct format.</p>aria-invalid="true"only while there's an error; once it's corrected, remove it (or set it tofalse).aria-describedbyaccepts severalidvalues separated by spaces: the screen reader reads the error first and then the hint.- The error paragraph is no longer hidden, so that it can be seen as well. The message is text, not just a colour (as you saw in the previous lesson).
Conclusion
ARIA is a set of attributes that modify the accessibility tree to communicate an element's role, name, description and state to assistive technologies when HTML isn't enough. You've learnt its golden rule (if there's a native element, use it) and the five rules of use; the categories of roles (landmark, structure and widget) and the implicit roles that semantic elements already provide, which you shouldn't repeat; how to give a name with aria-label and aria-labelledby, and a description with aria-describedby; when to hide with aria-hidden; the states aria-current, aria-expanded, aria-invalid and aria-required; live regions with aria-live; and why a div role="button" is almost always a mistake. At The Blue Cup you've checked that the existing uses of ARIA are correct, you've finally associated the booking form hints with their fields, you've made the gluten-free filter result be announced and you've given the conditions dialog a name. But how do you know all this really works for someone using a screen reader or only the keyboard? So far you've checked it in the code and in the DevTools pane. In the next lesson, Accessibility Testing, you'll learn to audit the site with automated tools and, above all, with manual tests: with the keyboard, with a screen reader, with zoom and with colour blindness simulation.
HTML Course
Module 1: Introduction to HTML
- What Is HTML?
- Setting Up Your Work Environment
- Basic Structure of an HTML Document
- Tags, Elements and Attributes
- Creating Your First HTML Page
- File Organisation and Paths
Module 2: Text Formatting in HTML
- Headings and Paragraphs
- Text Formatting Tags
- Lists: Ordered, Unordered and Description Lists
- Block Quotes and Preformatted Text
- Block and Inline Elements: div and span
Module 3: Links and Media in HTML
- Creating Hyperlinks
- Special Links: Anchors, Email, Phone and Downloads
- Adding Images
- Embedding Videos
- Using the Audio Element
Module 4: Tables in HTML
- Basic Table Structure
- Table Head, Body and Foot
- Merging Cells: colspan and rowspan
- Accessible Tables: caption, scope and headers
- Styling Tables
Module 5: Forms in HTML
- Creating a Basic Form
- Form Elements: input, textarea and select
- HTML5 Input Types
- Labels and Grouping: label, fieldset, legend and datalist
- Form Attributes and Validation
- Submitting Forms
Module 6: HTML5 Semantic Elements
- Introduction to Semantic HTML
- header, nav and footer
- article, section and aside
- main and figure
- Other Semantic Elements: time, address, details and dialog
Module 7: Advanced HTML Techniques
- HTML Entities
- Using iframes
- Data Attributes
- Metadata: meta, SEO and Open Graph
- Microdata and Structured Data
- Graphics in HTML: SVG and canvas
Module 8: Integrating HTML and CSS
- Linking CSS to HTML
- Inline, Internal and External CSS
- Basic CSS Selectors
- The Box Model
- Styling HTML Elements
- Introduction to Layout with Flexbox and Grid
Module 9: Responsive Web Design
Module 10: Best Practices and Accessibility
- HTML Best Practices
- Validating HTML Code
- Web Accessibility Basics
- Using ARIA Roles and Attributes
- Accessibility Testing
- Performance and Resource Loading
