Protected Learning Content

AICPE Gurukul content is created for learning purposes. Printing, copying and unauthorized reuse are restricted.

AICPE Learning Hub HTML with CSS
Chapter 12
Accessibility & ARIA Basics
Chapter 12 | Inclusive Web Design

Accessibility & ARIA Basics

Accessibility means making websites usable for everyone, including people using screen readers, keyboard navigation or assistive technologies. This chapter builds responsible web design habits.

Alt Text

Gives meaningful image descriptions for screen readers.

Labels

Connect form fields with clear field names.

Keyboard Access

Allows users to navigate without a mouse.

ARIA

Adds extra information when native HTML is not enough.

Learning Objectives

After This Chapter, You Will Understand

This chapter teaches the first steps toward inclusive and user-friendly webpage development.

Accessibility

Understand why websites should work for all users.

Alt Text

Write useful image descriptions for screen readers.

Forms

Create form fields with proper labels and instructions.

ARIA

Understand basic ARIA roles and aria-label usage.

Meaning

What is Web Accessibility?

Accessibility means creating websites that can be used by people with different abilities and devices.

1 Simple Meaning

A website should be usable by people who cannot see clearly, cannot use a mouse, use screen readers, use keyboard navigation, or have slower internet or older devices.

Definition: Web accessibility is the practice of designing and coding websites so that everyone can access and use them comfortably.

2 Why It Matters

  • Improves usability for all users
  • Helps screen reader users understand content
  • Makes forms easier to fill
  • Supports keyboard-only navigation
  • Creates more professional and responsible websites
Professional Tip: Accessibility is not an extra feature. It is a quality habit in modern web design.
Accessible HTML

Basic Accessible HTML Habits

Good accessibility starts with clean and meaningful HTML.

Practice Why It Helps Example
Use proper headings Creates a clear content structure Use h1, h2, h3 in order
Use semantic tags Helps assistive tools understand page areas header, nav, main, footer
Write alt text Explains images to screen reader users <img alt="Student using laptop">
Use descriptive links Explains where a link will take the user View Course Details
Use labels in forms Makes fields clear and clickable <label for="email">Email</label>
Keep enough contrast Makes text easier to read Dark text on light background

3 Good Alt Text

# Good alt text
<img src="student.jpg" alt="Student practicing HTML on laptop">

Good alt text describes the meaning of the image, not just the file name.

4 Poor Alt Text

# Poor alt text
<img src="student.jpg" alt="image">

Words like image, photo or pic do not explain what the image shows.

Accessible Forms

Labels and Helpful Instructions

Forms should be easy to understand, fill and submit.

5 Label Connection

The for attribute in label should match the id attribute of the input field. This makes the form field easier to use and understand.

<label for="email">Email Address</label>
<input type="email" id="email" name="email">

6 Helpful Message

Use clear instructions for fields like password, mobile number or file upload.

<label for="mobile">Mobile Number</label>
<input type="tel" id="mobile" aria-describedby="mobileHelp">
<small id="mobileHelp">Enter 10 digit mobile number.</small>
Practice Task: Create a form with name, email and mobile fields. Add labels and helpful instructions for each field.
Keyboard Navigation

Make Pages Keyboard Friendly

Many users navigate websites using Tab, Enter, Space and arrow keys.

Keyboard Focus Demo

View Course

Use the Tab key on your keyboard to move focus between these elements.

7 Focus Visibility

Keyboard users need to see which link, button or input is currently active. Never remove focus outline without giving a better visible focus style.

Avoid: outline:none; without providing another visible focus style.
Good: Add a clear focus border, shadow or outline so users can track navigation.
ARIA Basics

What is ARIA?

ARIA gives extra information to assistive technologies when normal HTML is not enough.

aria-label

Gives an accessible name when visible text is missing or not enough.

<button aria-label="Close menu">×</button>

aria-describedby

Connects an input field with a helpful instruction or explanation.

<input aria-describedby="help">
<small id="help">Enter valid email.</small>

role

Defines the purpose of an element when native semantic HTML is not enough.

<div role="alert">Form submitted.</div>
Golden Rule: Use normal semantic HTML first. Use ARIA only when HTML alone cannot communicate the meaning clearly.
Try It Yourself

Create an Accessible Contact Form

Edit the code and click Run Code to see the output.

HTML Code Edit and run
Write your enquiry in 2 to 3 lines.
Output Preview Browser result
Practice Task: Add a mobile number field with label, helpful instruction and required validation.
Common Mistakes

Mistakes Students Should Avoid

Accessibility mistakes can make websites difficult for many users.

Wrong Habits

  • Using images without meaningful alt text
  • Creating forms without labels
  • Writing vague link text like “click here”
  • Removing focus outline completely
  • Using ARIA everywhere without understanding

Correct Habits

  • Write meaningful alt text for important images
  • Use labels for all important form fields
  • Write descriptive link text
  • Keep clear keyboard focus style
  • Use semantic HTML before ARIA
Remember: ARIA can help when used correctly, but wrong ARIA can make accessibility worse.
Quick Quiz

Test Your Understanding

Select the correct answers and check your score.

1. Accessibility means:

Accessibility means making websites usable by people with different abilities and devices.

2. Which attribute describes an image?

The alt attribute gives a text description of an image.

3. Which tag gives a name to a form field?

The label tag gives a clear name to a form field.

4. Which attribute can give an accessible name to an icon-only button?

aria-label can provide an accessible name when visible text is missing.

5. What should be used first before ARIA?

Use semantic HTML first. Use ARIA only when native HTML is not enough.
Quick Revision

Remember These Points

Revise these before moving to Chapter 13.

Accessibility

It means creating websites that can be used comfortably by everyone.

Alt Text

Alt text describes images for screen reader users and when images do not load.

Labels

Labels make form fields clear and easier to use.

Keyboard Focus

Users should be able to navigate links, buttons and fields using the keyboard.

ARIA

ARIA adds extra accessibility information when normal HTML is not enough.

Semantic First

Use semantic HTML first, then use ARIA carefully only when needed.