ARIA Basics
ARIA (Accessible Rich Internet Applications) adds accessibility information to elements when HTML alone isn't enough. But remember: native HTML is always preferred.
The First Rule of ARIA
Rule #1: If you can use native HTML, do it.
<button>over<div role="button"><nav>over<div role="navigation"><main>over<div role="main">
ARIA Labels
Common labeling attributes:
aria-label- Provides invisible labelaria-labelledby- Points to element with labelaria-describedby- Points to description
ARIA Landmarks
Landmark roles help screen reader users navigate:
banner- Headernavigation- Navmain- Main contentcomplementary- Asidecontentinfo- Footersearch- Search area
ARIA for Dynamic Content
Live region values:
polite- Announce when convenientassertive- Announce immediately (use sparingly)
ARIA States
Common states:
aria-expanded- Expanded/collapsedaria-selected- Selected itemaria-checked- Checked statearia-disabled- Disabled statearia-hidden- Hidden from screen readers
ARIA for Forms
Form ARIA:
aria-required- Field is requiredaria-invalid- Field has erroraria-errormessage- Error message reference
Skip Links
Skip links let keyboard users bypass repetitive content.
Exercise: Add ARIA Attributes
Improve the accessibility with appropriate ARIA:
ARIA enhances accessibility when native HTML isn't enough - use it wisely!
التالي · الدرس 30 من 32
Code Organization
قراءة 1 دقيقة
أنهيت 29 من 32 درسًا

اسأل Byte عن هذا الدرس
محادثة خاصة حول هذا الدرس. قرأ Byte الدرس كاملًا، ويجيب خلال ثوانٍ، ويُظهر القسم الذي تأتي منه كل إجابة. يمكنك السؤال بأي لغة.
الأسئلة والأجوبة
أسئلة عامة حول هذا الدرس. يجيب AI Tutor فورًا بلغتك، ويراجع فريق FreeAcademy الإجابات، ويمكن لكل المتعلمين قراءتها.

