moai-lang-html-css
HTML5 Semantic Markup & CSS Best Practices with Accessibility Focus
Primary Agent: ui-ux-expert
Secondary Agent: frontend-expert
Version: 1.0.0
Keywords: html, semantic html, html5, css, styling, accessibility, a11y, wcag, responsive, semantics
📖 Progressive Disclosure
Level 1: Quick Reference (Core Concepts)
HTML Semantic Elements form the foundation of accessible, SEO-friendly web pages:
| Element |
Purpose |
Use Case |
<header> |
Page/section header |
Logo, navigation, branding |
<nav> |
Navigation container |
Menu, breadcrumbs, site links |
<main> |
Primary content |
Main page content (only one per page) |
<section> |
Thematic content group |
Articles, chapters, topics |
<article> |
Self-contained content |
Blog posts, news articles, comments |
<aside> |
Tangentially related content |
Sidebars, ads, related links |
<footer> |
Footer section |
Copyright, links, metadata |
CSS Best Practices:
- ✅ Mobile-first responsive design (min-width breakpoints)
- ✅ CSS custom properties for design tokens
- ✅ Utility-first approach (Tailwind) or BEM methodology
- ✅ Avoid inline styles; use classes
- ✅ Minimize CSS specificity (avoid
!important)
WCAG 2.1 AA Accessibility Checklist:
- 4.5:1 color contrast for text
- Keyboard navigation (Tab, Enter, Escape, Arrow keys)
- Focus indicators (2px solid outline)
- Semantic HTML (no
<div> for buttons)
- ARIA labels where necessary
Level 2: Practical Implementation (Common Patterns)
Pattern 1: Semantic HTML Page Structure
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Accessible Web Page</title>
<link rel="stylesheet" href="styles.css">
</head>
<body>
<!-- Page Header -->
<header role="banner">
<nav role="navigation" aria-label="Main navigation">
<a href="/" class="logo">Brand</a>
<ul>
<li><a href="/about">About</a></li>
<li><a href="/services">Services</a></li>
<li><a href="/contact">Contact</a></li>
</ul>
</nav>
</header>
<!-- Skip Link (accessibility best practice) -->
<a href="#main" class="sr-only">Skip to main content</a>
<!-- Main Content -->
<main id="main" role="main">
<!-- Article Section -->
<article>
<h1>Article Title</h1>
<p>Article introduction...</p>
<section>
<h2>Section Heading</h2>
<p>Section content...</p>
</section>
</article>
<!-- Sidebar -->
<aside aria-label="Related content">
<h3>Related Articles</h3>
<ul>
<li><a href="...">Related article 1</a></li>
<li><a href="...">Related article 2</a></li>
</ul>
</aside>
</main>
<!-- Page Footer -->
<footer role="contentinfo">
<p>© 2025 Company Name. All rights reserved.</p>
</footer>
</body>
</html>
Pattern 2: Accessible Form with Labels
<!-- WCAG 2.1 AA Compliant Form -->
<form method="POST" action="/submit">
<fieldset>
<legend>Contact Information</legend>
<!-- Email Input with Label -->
<div class="form-group">
<label for="email">Email Address *</label>
<input
id="email"
type="email"
name="email"
required
aria-required="true"
aria-describedby="email-help"
>
<small id="email-help">We'll never share your email</small>
</div>
<!-- Text Area -->
<div class="form-group">
<label for="message">Message *</label>
<textarea
id="message"
name="message"
rows="5"
required
aria-required="true"
></textarea>
</div>
<!-- Error Message (live region) -->
<div role="alert" aria-live="polite" id="form-error">
<!-- Error messages inserted here -->
</div>
<!-- Submit Button -->
<button type="submit" class="btn btn-primary">
Send Message
</button>
</fieldset>
</form>
Pattern 3: Responsive CSS with Custom Properties
/* Design Tokens as CSS Custom Properties */
:root {
/* Colors */
--color-primary: #0ea5e9;
--color-primary-dark: #0284c7;
--color-secondary: #8b5cf6;
--color-neutral-900: #111827;
--color-neutral-500: #6b7280;
--color-neutral-100: #f3f4f6;
/* Typography */
--font-family-sans: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
--font-family-mono: "Monaco", "Menlo", "Ubuntu Mono", monospace;
--font-size-sm: 0.875rem;
--font-size-base: 1rem;
--font-size-lg: 1.125rem;
--font-size-xl: 1.25rem;
--font-size-2xl: 1.5rem;
--font-weight-normal: 400;
--font-weight-medium: 500;
--font-weight-bold: 700;
/* Spacing (8px base unit) */
--spacing-xs: 0.25rem;
--spacing-sm: 0.5rem;
--spacing-md: 1rem;
--spacing-lg: 1.5rem;
--spacing-xl: 2rem;
--spacing-2xl: 3rem;
/* Breakpoints */
--breakpoint-sm: 640px;
--breakpoint-md: 768px;
--breakpoint-lg: 1024px;
--breakpoint-xl: 1280px;
/* Shadows */
--shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.05);
--shadow-md: 0 4px 6px rgba(0, 0, 0, 0.1);
--shadow-lg: 0 10px 15px rgba(0, 0, 0, 0.1);
}
/* Base Styles */
html {
scroll-behavior: smooth;
}
body {
font-family: var(--font-family-sans);
font-size: var(--font-size-base);
color: var(--color-neutral-900);
line-height: 1.5;
-webkit-font-smoothing: antialiased;
}
/* Typography */
h1, h2, h3, h4, h5, h6 {
font-weight: var(--font-weight-bold);
line-height: 1.2;
}
h1 {
font-size: var(--font-size-2xl);
margin-bottom: var(--spacing-lg);
}
h2 {
font-size: var(--font-size-xl);
margin-bottom: var(--spacing-md);
}
p {
margin-bottom: var(--spacing-md);
}
/* Button Component */
.btn {
display: inline-flex;
align-items: center;
justify-content: center;
padding: var(--spacing-sm) var(--spacing-md);
font-weight: var(--font-weight-medium);
border: none;
border-radius: 0.375rem;
cursor: pointer;
transition: all 0.2s ease;
/* Focus indicator (WCAG AA) */
outline: none;
}
.btn:focus-visible {
outline: 2px solid var(--color-primary);
outline-offset: 2px;
}
.btn:disabled {
opacity: 0.5;
cursor: not-allowed;
}
.btn-primary {
background-color: var(--color-primary);
color: white;
}
.btn-primary:hover {
background-color: var(--color-primary-dark);
}
/* Form Group */
.form-group {
margin-bottom: var(--spacing-lg);
}
label {
display: block;
font-weight: var(--font-weight-medium);
margin-bottom: var(--spacing-sm);
}
input, textarea, select {
width: 100%;
padding: var(--spacing-sm) var(--spacing-md);
border: 1px solid var(--color-neutral-300);
border-radius: 0.375rem;
font-family: inherit;
font-size: inherit;
}
input:focus, textarea:focus, select:focus {
outline: none;
border-color: var(--color-primary);
box-shadow: 0 0 0 3px rgba(14, 165, 233, 0.1);
}
input:invalid {
border-color: #ef4444;
}
/* Responsive Grid (Mobile-First) */
.grid {
display: grid;
gap: var(--spacing-md);
}
@media (min-width: var(--breakpoint-md)) {
.grid {
grid-template-columns: repeat(2, 1fr);
}
}
@media (min-width: var(--breakpoint-lg)) {
.grid {
grid-template-columns: repeat(3, 1fr);
}
}
/* Screen Reader Only (a11y) */
.sr-only {
position: absolute;
width: 1px;
height: 1px;
padding: 0;
margin: -1px;
overflow: hidden;
clip: rect(0, 0, 0, 0);
white-space: nowrap;
border-width: 0;
}
/* Focus Visible (keyboard accessibility) */
:focus-visible {
outline: 2px solid var(--color-primary);
outline-offset: 2px;
}
Level 3: Advanced Patterns (Expert Reference)
Advanced Pattern 1: Accessible Modal Dialog
<div role="dialog"
aria-modal="true"
aria-labelledby="modal-title"
aria-describedby="modal-description">
<div class="modal-overlay"
<div class="modal-content">
<button
class="modal-close"
aria-label="Close dialog"
✕
</button>
<h2 id="modal-title">Dialog Title</h2>
<p id="modal-description">Dialog description...</p>
<button class="btn btn-primary">Action</button>
</div>
</div>
<style>
[role="dialog"] {
position: fixed;
top: 0;
left: 0;
right: 0;
bottom: 0;
display: flex;
align-items: center;
justify-content: center;
z-index: 50;
}
.modal-overlay {
position: absolute;
inset: 0;
background-color: rgba(0, 0, 0, 0.5);
}
.modal-content {
position: relative;
background: white;
border-radius: 0.5rem;
padding: 2rem;
max-width: 500px;
box-shadow: 0 20px 25px rgba(0, 0, 0, 0.15);
}
/* Focus trap for keyboard users */
[role="dialog"]:focus-within .modal-content {
outline: 2px solid var(--color-primary);
}
</style>
<script>
function closeModal() {
const dialog = document.querySelector('[role="dialog"]');
dialog.remove();
// Restore focus to trigger element
previousFocusElement?.focus();
}
// Focus trap (prevent Tab from leaving modal)
document.addEventListener('keydown', (e) => {
if (e.key === 'Escape') closeModal();
});
</script>
Advanced Pattern 2: Skip Navigation (A11y Best Practice)
<!-- Place at very beginning of <body> -->
<a href="#main" class="sr-only skip-link">Skip to main content</a>
<style>
.skip-link {
position: absolute;
top: -40px;
left: 0;
background: var(--color-primary);
color: white;
padding: 0.5rem 1rem;
text-decoration: none;
z-index: 100;
}
.skip-link:focus {
top: 0;
}
</style>
🎯 Best Practices Checklist
HTML
- ✅ Use semantic HTML5 elements (
<header>, <nav>, <main>, <section>, <article>, <aside>, <footer>)
- ✅ Proper heading hierarchy (
<h1> → <h2> → <h3>, never skip levels)
- ✅ Form labels explicitly connected with
<label for="id"> and input id="id"
- ✅ Alternative text for all images:
<img alt="description">
- ✅ Landmark roles for screen readers:
role="banner", role="main", role="contentinfo"
CSS
- ✅ Mobile-first responsive design (start at mobile, add styles for larger screens)
- ✅ Use CSS custom properties for design tokens (colors, spacing, typography)
- ✅ Maintain 4.5:1 color contrast for normal text (WCAG AA)
- ✅ Visible focus indicators for keyboard users (
:focus-visible, 2px outline)
- ✅ Use
rem or em for sizing (not px) for better font scaling
Accessibility (WCAG 2.1 AA)
- ✅ Color contrast: Text 4.5:1, UI components 3:1 (use WebAIM contrast checker)
- ✅ Keyboard navigation: All functionality accessible via Tab, Enter, Escape, arrow keys
- ✅ Focus visible: Clear focus indicators (2px solid outline preferred)
- ✅ Semantic HTML foundation: Proper heading levels, form labels, alt text
- ✅ ARIA only when semantic HTML insufficient:
aria-label, aria-describedby, role="alert"
- ✅ Skip links: Allow skipping repetitive navigation
📚 Official References
🔗 Related Skills
Skill("moai-lang-tailwind-css") – Utility-first CSS framework
Skill("moai-lib-shadcn-ui") – React components with Tailwind + Radix
Skill("moai-domain-frontend") – Full frontend architecture
1---2name: moai-lang-html-css3description: Enterprise Skill for advanced development4---5
6# moai-lang-html-css
7
8**HTML5 Semantic Markup & CSS Best Practices with Accessibility Focus**
9
10> **Primary Agent**: ui-ux-expert
11> **Secondary Agent**: frontend-expert
12> **Version**: 1.0.0
13> **Keywords**: html, semantic html, html5, css, styling, accessibility, a11y, wcag, responsive, semantics
14
15---
16
17## 📖 Progressive Disclosure
18
19### Level 1: Quick Reference (Core Concepts)
20
21**HTML Semantic Elements** form the foundation of accessible, SEO-friendly web pages:
22
23| Element | Purpose | Use Case |
24|---------|---------|----------|
25| `<header>` | Page/section header | Logo, navigation, branding |
26| `<nav>` | Navigation container | Menu, breadcrumbs, site links |
27| `<main>` | Primary content | Main page content (only one per page) |
28| `<section>` | Thematic content group | Articles, chapters, topics |
29| `<article>` | Self-contained content | Blog posts, news articles, comments |
30| `<aside>` | Tangentially related content | Sidebars, ads, related links |
31| `<footer>` | Footer section | Copyright, links, metadata |
32
33**CSS Best Practices**:
34- ✅ Mobile-first responsive design (min-width breakpoints)
35- ✅ CSS custom properties for design tokens
36- ✅ Utility-first approach (Tailwind) or BEM methodology
37- ✅ Avoid inline styles; use classes
38- ✅ Minimize CSS specificity (avoid `!important`)
39
40**WCAG 2.1 AA Accessibility Checklist**:
41- 4.5:1 color contrast for text
42- Keyboard navigation (Tab, Enter, Escape, Arrow keys)
43- Focus indicators (2px solid outline)
44- Semantic HTML (no `<div>` for buttons)
45- ARIA labels where necessary
46
47---
48
49### Level 2: Practical Implementation (Common Patterns)
50
51#### Pattern 1: Semantic HTML Page Structure
52
53```html
54<!DOCTYPE html>
55<html lang="en">
56<head>
57 <meta charset="UTF-8">
58 <meta name="viewport" content="width=device-width, initial-scale=1.0">
59 <title>Accessible Web Page</title>
60 <link rel="stylesheet" href="styles.css">
61</head>
62<body>
63 <!-- Page Header -->
64 <header role="banner">
65 <nav role="navigation" aria-label="Main navigation">
66 <a href="/" class="logo">Brand</a>
67 <ul>
68 <li><a href="/about">About</a></li>
69 <li><a href="/services">Services</a></li>
70 <li><a href="/contact">Contact</a></li>
71 </ul>
72 </nav>
73 </header>
74
75 <!-- Skip Link (accessibility best practice) -->
76 <a href="#main" class="sr-only">Skip to main content</a>
77
78 <!-- Main Content -->
79 <main id="main" role="main">
80 <!-- Article Section -->
81 <article>
82 <h1>Article Title</h1>
83 <p>Article introduction...</p>
84 <section>
85 <h2>Section Heading</h2>
86 <p>Section content...</p>
87 </section>
88 </article>
89
90 <!-- Sidebar -->
91 <aside aria-label="Related content">
92 <h3>Related Articles</h3>
93 <ul>
94 <li><a href="...">Related article 1</a></li>
95 <li><a href="...">Related article 2</a></li>
96 </ul>
97 </aside>
98 </main>
99
100 <!-- Page Footer -->
101 <footer role="contentinfo">
102 <p>© 2025 Company Name. All rights reserved.</p>
103 </footer>
104</body>
105</html>
106```
107
108#### Pattern 2: Accessible Form with Labels
109
110```html
111<!-- WCAG 2.1 AA Compliant Form -->
112<form method="POST" action="/submit">
113 <fieldset>
114 <legend>Contact Information</legend>
115
116 <!-- Email Input with Label -->
117 <div class="form-group">
118 <label for="email">Email Address *</label>
119 <input
120 id="email"
121 type="email"
122 name="email"
123 required
124 aria-required="true"
125 aria-describedby="email-help"
126 >
127 <small id="email-help">We'll never share your email</small>
128 </div>
129
130 <!-- Text Area -->
131 <div class="form-group">
132 <label for="message">Message *</label>
133 <textarea
134 id="message"
135 name="message"
136 rows="5"
137 required
138 aria-required="true"
139 ></textarea>
140 </div>
141
142 <!-- Error Message (live region) -->
143 <div role="alert" aria-live="polite" id="form-error">
144 <!-- Error messages inserted here -->
145 </div>
146
147 <!-- Submit Button -->
148 <button type="submit" class="btn btn-primary">
149 Send Message
150 </button>
151 </fieldset>
152</form>
153```
154
155#### Pattern 3: Responsive CSS with Custom Properties
156
157```css
158/* Design Tokens as CSS Custom Properties */
159:root {
160 /* Colors */
161 --color-primary: #0ea5e9;
162 --color-primary-dark: #0284c7;
163 --color-secondary: #8b5cf6;
164 --color-neutral-900: #111827;
165 --color-neutral-500: #6b7280;
166 --color-neutral-100: #f3f4f6;
167
168 /* Typography */
169 --font-family-sans: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
170 --font-family-mono: "Monaco", "Menlo", "Ubuntu Mono", monospace;
171 --font-size-sm: 0.875rem;
172 --font-size-base: 1rem;
173 --font-size-lg: 1.125rem;
174 --font-size-xl: 1.25rem;
175 --font-size-2xl: 1.5rem;
176 --font-weight-normal: 400;
177 --font-weight-medium: 500;
178 --font-weight-bold: 700;
179
180 /* Spacing (8px base unit) */
181 --spacing-xs: 0.25rem;
182 --spacing-sm: 0.5rem;
183 --spacing-md: 1rem;
184 --spacing-lg: 1.5rem;
185 --spacing-xl: 2rem;
186 --spacing-2xl: 3rem;
187
188 /* Breakpoints */
189 --breakpoint-sm: 640px;
190 --breakpoint-md: 768px;
191 --breakpoint-lg: 1024px;
192 --breakpoint-xl: 1280px;
193
194 /* Shadows */
195 --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.05);
196 --shadow-md: 0 4px 6px rgba(0, 0, 0, 0.1);
197 --shadow-lg: 0 10px 15px rgba(0, 0, 0, 0.1);
198}
199
200/* Base Styles */
201html {
202 scroll-behavior: smooth;
203}
204
205body {
206 font-family: var(--font-family-sans);
207 font-size: var(--font-size-base);
208 color: var(--color-neutral-900);
209 line-height: 1.5;
210 -webkit-font-smoothing: antialiased;
211}
212
213/* Typography */
214h1, h2, h3, h4, h5, h6 {
215 font-weight: var(--font-weight-bold);
216 line-height: 1.2;
217}
218
219h1 {
220 font-size: var(--font-size-2xl);
221 margin-bottom: var(--spacing-lg);
222}
223
224h2 {
225 font-size: var(--font-size-xl);
226 margin-bottom: var(--spacing-md);
227}
228
229p {
230 margin-bottom: var(--spacing-md);
231}
232
233/* Button Component */
234.btn {
235 display: inline-flex;
236 align-items: center;
237 justify-content: center;
238 padding: var(--spacing-sm) var(--spacing-md);
239 font-weight: var(--font-weight-medium);
240 border: none;
241 border-radius: 0.375rem;
242 cursor: pointer;
243 transition: all 0.2s ease;
244
245 /* Focus indicator (WCAG AA) */
246 outline: none;
247}
248
249.btn:focus-visible {
250 outline: 2px solid var(--color-primary);
251 outline-offset: 2px;
252}
253
254.btn:disabled {
255 opacity: 0.5;
256 cursor: not-allowed;
257}
258
259.btn-primary {
260 background-color: var(--color-primary);
261 color: white;
262}
263
264.btn-primary:hover {
265 background-color: var(--color-primary-dark);
266}
267
268/* Form Group */
269.form-group {
270 margin-bottom: var(--spacing-lg);
271}
272
273label {
274 display: block;
275 font-weight: var(--font-weight-medium);
276 margin-bottom: var(--spacing-sm);
277}
278
279input, textarea, select {
280 width: 100%;
281 padding: var(--spacing-sm) var(--spacing-md);
282 border: 1px solid var(--color-neutral-300);
283 border-radius: 0.375rem;
284 font-family: inherit;
285 font-size: inherit;
286}
287
288input:focus, textarea:focus, select:focus {
289 outline: none;
290 border-color: var(--color-primary);
291 box-shadow: 0 0 0 3px rgba(14, 165, 233, 0.1);
292}
293
294input:invalid {
295 border-color: #ef4444;
296}
297
298/* Responsive Grid (Mobile-First) */
299.grid {
300 display: grid;
301 gap: var(--spacing-md);
302}
303
304@media (min-width: var(--breakpoint-md)) {
305 .grid {
306 grid-template-columns: repeat(2, 1fr);
307 }
308}
309
310@media (min-width: var(--breakpoint-lg)) {
311 .grid {
312 grid-template-columns: repeat(3, 1fr);
313 }
314}
315
316/* Screen Reader Only (a11y) */
317.sr-only {
318 position: absolute;
319 width: 1px;
320 height: 1px;
321 padding: 0;
322 margin: -1px;
323 overflow: hidden;
324 clip: rect(0, 0, 0, 0);
325 white-space: nowrap;
326 border-width: 0;
327}
328
329/* Focus Visible (keyboard accessibility) */
330:focus-visible {
331 outline: 2px solid var(--color-primary);
332 outline-offset: 2px;
333}
334```
335
336---
337
338### Level 3: Advanced Patterns (Expert Reference)
339
340#### Advanced Pattern 1: Accessible Modal Dialog
341
342```html
343<div role="dialog"
344 aria-modal="true"
345 aria-labelledby="modal-title"
346 aria-describedby="modal-description">
347 <div class="modal-overlay" onclick="closeModal()"></div>
348 <div class="modal-content">
349 <button
350 class="modal-close"
351 aria-label="Close dialog"
352 onclick="closeModal()">
353 ✕
354 </button>
355 <h2 id="modal-title">Dialog Title</h2>
356 <p id="modal-description">Dialog description...</p>
357 <button class="btn btn-primary">Action</button>
358 </div>
359</div>
360
361<style>
362 [role="dialog"] {
363 position: fixed;
364 top: 0;
365 left: 0;
366 right: 0;
367 bottom: 0;
368 display: flex;
369 align-items: center;
370 justify-content: center;
371 z-index: 50;
372 }
373
374 .modal-overlay {
375 position: absolute;
376 inset: 0;
377 background-color: rgba(0, 0, 0, 0.5);
378 }
379
380 .modal-content {
381 position: relative;
382 background: white;
383 border-radius: 0.5rem;
384 padding: 2rem;
385 max-width: 500px;
386 box-shadow: 0 20px 25px rgba(0, 0, 0, 0.15);
387 }
388
389 /* Focus trap for keyboard users */
390 [role="dialog"]:focus-within .modal-content {
391 outline: 2px solid var(--color-primary);
392 }
393</style>
394
395<script>
396 function closeModal() {
397 const dialog = document.querySelector('[role="dialog"]');
398 dialog.remove();
399 // Restore focus to trigger element
400 previousFocusElement?.focus();
401 }
402
403 // Focus trap (prevent Tab from leaving modal)
404 document.addEventListener('keydown', (e) => {
405 if (e.key === 'Escape') closeModal();
406 });
407</script>
408```
409
410#### Advanced Pattern 2: Skip Navigation (A11y Best Practice)
411
412```html
413<!-- Place at very beginning of <body> -->
414<a href="#main" class="sr-only skip-link">Skip to main content</a>
415
416<style>
417 .skip-link {
418 position: absolute;
419 top: -40px;
420 left: 0;
421 background: var(--color-primary);
422 color: white;
423 padding: 0.5rem 1rem;
424 text-decoration: none;
425 z-index: 100;
426 }
427
428 .skip-link:focus {
429 top: 0;
430 }
431</style>
432```
433
434---
435
436## 🎯 Best Practices Checklist
437
438### HTML
439- ✅ Use semantic HTML5 elements (`<header>`, `<nav>`, `<main>`, `<section>`, `<article>`, `<aside>`, `<footer>`)
440- ✅ Proper heading hierarchy (`<h1>` → `<h2>` → `<h3>`, never skip levels)
441- ✅ Form labels explicitly connected with `<label for="id">` and `input id="id"`
442- ✅ Alternative text for all images: `<img alt="description">`
443- ✅ Landmark roles for screen readers: `role="banner"`, `role="main"`, `role="contentinfo"`
444
445### CSS
446- ✅ Mobile-first responsive design (start at mobile, add styles for larger screens)
447- ✅ Use CSS custom properties for design tokens (colors, spacing, typography)
448- ✅ Maintain 4.5:1 color contrast for normal text (WCAG AA)
449- ✅ Visible focus indicators for keyboard users (`:focus-visible`, 2px outline)
450- ✅ Use `rem` or `em` for sizing (not `px`) for better font scaling
451
452### Accessibility (WCAG 2.1 AA)
453- ✅ Color contrast: Text 4.5:1, UI components 3:1 (use WebAIM contrast checker)
454- ✅ Keyboard navigation: All functionality accessible via Tab, Enter, Escape, arrow keys
455- ✅ Focus visible: Clear focus indicators (2px solid outline preferred)
456- ✅ Semantic HTML foundation: Proper heading levels, form labels, alt text
457- ✅ ARIA only when semantic HTML insufficient: `aria-label`, `aria-describedby`, `role="alert"`
458- ✅ Skip links: Allow skipping repetitive navigation
459
460---
461
462## 📚 Official References
463
464- **W3C HTML5 Spec**: https://html.spec.whatwg.org/
465- **WCAG 2.1 Guidelines**: https://www.w3.org/WAI/WCAG21/quickref/
466- **MDN Web Docs - HTML**: https://developer.mozilla.org/en-US/docs/Web/HTML
467- **MDN Web Docs - CSS**: https://developer.mozilla.org/en-US/docs/Web/CSS
468- **WebAIM - Contrast Checker**: https://webaim.org/resources/contrastchecker/
469- **WAI-ARIA Authoring Practices**: https://www.w3.org/WAI/ARIA/apg/
470
471---
472
473## 🔗 Related Skills
474
475- `Skill("moai-lang-tailwind-css")` – Utility-first CSS framework
476- `Skill("moai-lib-shadcn-ui")` – React components with Tailwind + Radix
477- `Skill("moai-domain-frontend")` – Full frontend architecture