Accessibility Basics
This lesson explains Accessibility Basics in web accessibility with clear examples, practical use cases, and implementation best practices.
Web Accessibility Basics Overview
Web Accessibility Basics introduce the essential techniques every developer
should follow to build websites that are usable by everyone. Accessibility
starts with writing semantic HTML, providing meaningful content, supporting
keyboard navigation, and ensuring compatibility with assistive technologies
such as screen readers.
Building accessibility from the beginning reduces development costs,
improves usability, supports SEO, and helps websites comply with
accessibility standards like WCAG.
| Accessibility Basic | Purpose |
| Semantic HTML | Provides meaningful page structure |
| Keyboard Navigation | Allows users to navigate without a mouse |
| Alternative Text | Describes images for screen readers |
| Form Labels | Improves form accessibility |
| Color Contrast | Makes content easier to read |
| Focus Indicators | Shows keyboard users where they are |
Basic Accessible HTML Example
<main>
<h1>Accessibility Basics</h1>
<button type="button">
Save Changes
</button>
</main>
Using semantic HTML elements like main,
h1, and button provides built-in
accessibility support for browsers and assistive technologies without
additional ARIA attributes.
Essential Accessibility Fundamentals
Every accessible website should include a few core building blocks. These
fundamentals improve usability for everyone and create a solid foundation
before implementing advanced accessibility techniques.
| Feature | Why It Matters | Best Practice |
| Semantic HTML | Helps browsers understand page structure | Use header, nav, main, section, article and footer |
| Headings | Improves navigation | Follow logical heading hierarchy |
| Images | Supports screen readers | Add meaningful alt text |
| Forms | Improves usability | Associate labels with controls |
| Keyboard Support | Allows navigation without a mouse | Ensure all controls are reachable |
| Focus | Shows active element | Never remove visible focus styles |
Accessibility Best Practices
| Practice | Recommendation |
| Use Semantic HTML | Prefer native HTML elements over generic div elements. |
| Write Descriptive Text | Use meaningful headings, labels, and link text. |
| Support Keyboard Users | Ensure every interactive element is keyboard accessible. |
| Provide Alternative Text | Describe informative images with accurate alt text. |
| Maintain Contrast | Choose text and background colors with sufficient contrast. |
| Test Accessibility | Use browser tools, screen readers, and keyboard navigation. |
Common Accessibility Mistakes
- Using div elements instead of buttons or links.
- Skipping heading levels such as jumping from h1 to h4.
- Missing labels on form controls.
- Using images without alternative text.
- Relying only on color to communicate information.
- Removing keyboard focus outlines.
- Using tiny clickable areas on mobile devices.
- Writing vague link text like "Click Here."
Key Takeaways
- Accessibility should be considered from the beginning of every project.
- Semantic HTML is the foundation of accessible websites.
- Every interactive element should support keyboard navigation.
- Alternative text helps users understand non-text content.
- Clear labels, headings, and navigation improve usability and SEO.
- Testing accessibility regularly helps identify issues before deployment.
Pro Tip
Before adding ARIA attributes, check whether a native HTML element already
provides the accessibility behavior you need. Native HTML is simpler,
performs better, and is supported by all major browsers and assistive
technologies.