Web Accessibility (a11y) & ARIA
The web is for everyone. Building accessible websites ensures people with disabilities, visual impairments, or motor challenges can learn and navigate seamlessly.
What is it?
Web accessibility (often abbreviated as a11y) is the practice of designing websites that people with disabilities can use with assistive technologies (like screen readers). ARIA (Accessible Rich Internet Applications) provides extra attributes to bridge gaps in complex dynamic UIs.
Why is it used?
Accessible websites are legally required in many jurisdictions, improve usability for all users (e.g. keyboard navigation), and rank higher on search engines.
Detailed Explanation
Syntax Structure
<!-- Accessible Button with Icon -->
<button type="button" aria-label="Close Navigation Menu">
<svg aria-hidden="true">...</svg>
</button>
Code Example
<!-- Accessible Accordion / Toggle -->
<section aria-labelledby="faq-heading">
<h2 id="faq-heading">Frequently Asked Questions</h2>
<div class="faq-item">
<button
type="button"
class="faq-trigger"
aria-expanded="false"
aria-controls="faq-answer-1"
id="faq-btn-1"
>
Do you provide MKCL KLiC course certificates?
</button>
<div
id="faq-answer-1"
class="faq-content"
role="region"
aria-labelledby="faq-btn-1"
hidden
>
<p>Yes, all successful students receive official, government-recognized MKCL KLiC certificates.</p>
</div>
</div>
</section>
Explanation of the Code
Expected Output
Real-World Application
Major enterprises (Google, Microsoft, Apple, government portals) conduct rigorous automated and manual accessibility audits before launching any feature.
Common Mistakes to Avoid
Quick Practice Challenge
Take an icon-only search button and make it accessible using `aria-label` and `aria-hidden` on the icon.