Emad Zedan Accessible Web Design Sample With Explanations
For Technical Interviewer: Please Check Page Source Code For Details (CTRL + U)
1. High Color Contrast (WCAG AA+)
The contrast ratio between text and background should meet at least 4.5:1 for normal text (WCAG AA). This is the single most important factor for users with low vision or color blindness.
Accessible Example
This white text on a deep primary background has a high contrast ratio (well over 4.5:1) and is easy to read.
Inaccessible Example
This yellow text on light gray is a common contrast error. Avoid using pale or weak colors for important content.
2. Images and Alternative Text (`alt`)
All functional or informative images **must** have a descriptive `alt` attribute. Screen readers read this text aloud.
Image with Descriptive Alt Text:
<img src="..." alt="A blue circle with the word ACCESSIBLE in white, representing the accessibility symbol.">
If an image is purely decorative (e.g., a background texture), use `alt=""` (an empty string) to tell the screen reader to ignore it.
3. ARIA Roles and Properties
ARIA (Accessible Rich Internet Applications) helps when standard HTML is insufficient. Use it sparingly, mainly for dynamic content or custom UI components.
Status Message (Read Aloud Immediately)
role="status" is used here. It's an **ARIA live region**, telling the screen reader to interrupt and announce this message. Great for successful form submissions.
Interactive Element Labeling
aria-label gives the button a name when its content is just an icon (`aria-hidden="true"` on the icon prevents the icon itself from being read).
4. Keyboard Operability and Focus
Everything operable with a mouse must be operable with a keyboard (using `Tab`, `Shift+Tab`, `Enter`, and `Space`). Semantic elements like <button> and <input> handle this automatically.
**The most important takeaway:** Always use the correct HTML element (<button>) instead of trying to hack a <div> with `tabindex` and event handlers.
5. Form Accessibility (Labels & Errors)
Forms must have clearly associated labels. Errors need to be communicated not only visually but also programmatically for screen readers.
6. Language and Viewport Structure
These structural elements are fundamental for screen reader pronunciation and visual scaling for low-vision users.
-
Language (`lang`)
The entire document must specify its language in the
<html>tag. Screen readers use this to load the correct voice and accent.<html lang="en"> -
Viewport & Zoom (WCAG 1.4.4)
The
<meta name="viewport">tag is critical to ensure users can **zoom up to 200%** without loss of content or horizontal scrolling.<meta name="viewport" content="width=device-width, initial-scale=1.0"> -
Text Resizing
Avoid using `!important` on font sizes or fixed heights, as this can prevent low-vision users from correctly adjusting text size via browser settings.