Lesson 3.4: Semantic HTML and Accessibility

Building Websites That Work for Everyone - Inclusive Design and Modern HTML

๐Ÿ• 60 minutes ๐ŸŸก Intermediate

โ™ฟ Welcome to Inclusive Web Development!

Accessibility isn't just a nice-to-have feature - it's essential for creating websites that work for everyone. In this final lesson of Module 3, you'll learn how to use semantic HTML elements and accessibility best practices to build websites that are usable by people with disabilities, work well with assistive technologies, and follow modern web standards.

Semantic HTML and accessibility are the hallmarks of professional web development. They ensure your websites work for everyone, regardless of their abilities or the devices they use.

๐Ÿ—๏ธ Understanding Semantic HTML

Semantic HTML uses elements that clearly describe their meaning and purpose, rather than just their appearance. This helps browsers, search engines, and assistive technologies understand your content structure.

Contains introductory content, navigation, or site branding

Contains navigation links and menus

Contains the primary content of the page

Contains independent, self-contained content

Groups related content together

Contains content related to but separate from main content

Contains footer information and links

๐Ÿ“‹ Building a Semantic Page Structure

Let's create a complete webpage using semantic HTML elements:

Semantic HTML Page Structure

Why This Structure Matters

  • Screen readers can quickly navigate to main content, navigation, etc.
  • Search engines better understand page structure and content hierarchy
  • Developers can easily identify and modify different page sections
  • Styling becomes more predictable and maintainable

โ™ฟ Essential Accessibility Principles

Accessibility (often called "a11y") ensures your websites work for people with disabilities. Here are the core principles:

The POUR Principles

  • Perceivable: Information must be presentable in ways users can perceive
  • Operable: Interface components must be operable by all users
  • Understandable: Information and operation must be understandable
  • Robust: Content must work with current and future technologies

๐Ÿ” ARIA Attributes for Enhanced Accessibility

ARIA (Accessible Rich Internet Applications) attributes provide additional context for assistive technologies:

Common ARIA Attributes

๐ŸŽจ Color and Contrast Accessibility

Color choices can make or break accessibility. Always ensure sufficient contrast:

๐ŸŒŸ Color Contrast Guidelines

  • Normal text: 4.5:1 contrast ratio minimum
  • Large text: 3:1 contrast ratio minimum
  • Don't rely on color alone: Use shapes, patterns, or text
  • Test with tools: Use contrast checkers and color blindness simulators

โŒจ๏ธ Keyboard Navigation

Ensure all interactive elements work with keyboard navigation:

Keyboard-Accessible Elements

๐Ÿ› ๏ธ Create an Accessible Website

Build a complete webpage that incorporates semantic HTML and accessibility best practices:

  1. Use semantic elements: header, nav, main, section, article, aside, footer
  2. Add proper headings: h1-h6 in logical hierarchy
  3. Include alt text: For all images
  4. Use labels: For all form inputs
  5. Test keyboard navigation: Tab through all interactive elements
  6. Check contrast: Ensure text is readable

Create a simple blog post page or personal profile page with these accessibility features!

๐Ÿงช Testing Accessibility

Use these tools and methods to test your accessibility:

Automated Tools

Use WAVE, Lighthouse, or axe DevTools to scan for accessibility issues

Manual Testing

Navigate with keyboard only, test with screen readers, check color contrast

User Testing

Have people with disabilities test your website and provide feedback

๐ŸŽฏ Why Accessibility Matters

Beyond being the right thing to do, accessibility has practical benefits:

๐Ÿ“ˆ Better SEO

Search engines favor accessible websites

๐Ÿ“ฑ Mobile Friendly

Accessible sites work better on mobile devices

โš–๏ธ Legal Compliance

Many countries require accessibility for government websites

๐ŸŒ Wider Audience

Reach more users, including those with temporary disabilities

๐ŸŽ‰ Module 3 Complete - You're a Professional Web Developer!

Congratulations! You've completed Module 3 and now have advanced HTML skills that set you apart as a professional web developer.

โœ… What You've Mastered in Module 3:
  • โœ… Lists and structured data organization
  • โœ… Professional table creation and accessibility
  • โœ… Interactive forms and user input collection
  • โœ… Semantic HTML elements and page structure
  • โœ… Accessibility principles and ARIA attributes
  • โœ… Inclusive design and keyboard navigation
  • โœ… Professional web development standards
You now have all the HTML skills needed to build professional, accessible websites. You've moved from basic HTML to advanced, industry-standard web development practices.

In Module 4, you'll apply everything you've learned to create real-world projects - a personal profile page, multi-page website, and interactive portfolio that you can actually use and share!

โ† Back: Forms and User Interaction Next Module: Real-World Projects โ†’