Course

Web Development
  • 1.1 Introduction to the Web
  • 2.1 HTML Basics
  • 2.2 Text & Content
  • 2.3 Layout & Grouping
  • 2.4 Lists & Tables
  • 2.5 Media & Embedding
  • 2.6 Forms
  • 2.7 Semantic HTML
  • 2.8 Accessibility & SEO
  • 3.1 CSS Introduction
  • 3.2 CSS Syntax
  • 3.3 CSS Selectors
  • 3.4 Typography
  • 3.5 Colors & Backgrounds
  • 3.6 Text Styling
  • 3.7 Box Model
  • 3.8 Units
  • 3.9 Display & Positioning
  • 3.10 Layout Systems
  • 3.11 Responsive Design
  • 3.12 Animations
  • 3.13 Modern CSS
  • 3.14 Performance & Accessibility
  • 3.15 Tailwind CSS Basics
  • 4.1 Introduction to JavaScript
  • 4.2 Variables & Scope
  • 4.3 Data Types
  • 4.4 Type Conversion
  • 4.5 Operators
  • 4.6 Control Flow
  • 4.7 Loops
  • 4.8 Functions
  • 4.9 Advanced Functions
  • 4.10 Objects & Arrays
  • 4.11 The this Keyword

2.8 Accessibility & SEO

Updated Jul 4, 2026

2.8 Accessibility & SEO

Updated Jul 4, 2026

Modern websites should not only look good but also be accessible to everyone and easy for search engines to understand.

Accessibility (A11Y) focuses on making websites usable by all users, including people with disabilities.

SEO (Search Engine Optimization) focuses on improving a website's visibility in search engines like Google.


Accessibility Basics

Accessibility means designing websites that everyone can use, including people with:

  • Visual impairments
  • Hearing impairments
  • Motor disabilities
  • Cognitive disabilities

The goal is to ensure users can:

  • Read content
  • Navigate pages
  • Fill out forms
  • Access information

Why Accessibility Matters

Accessible websites are better for everyone.

Benefits include:

  • Inclusive user experience
  • Better usability
  • Legal compliance
  • Improved SEO

Accessibility Best Practices

Use Semantic HTML

Avoid generic elements when a semantic element exists.

Bad:

<div>Login</div>

Good:

<button>
    Login
</button>

Browsers and screen readers immediately understand the purpose of a <button>.


Always Use Alt Text

Bad:

<img src="logo.png">

Good:

<img
    src="logo.png"
    alt="Company Logo">

If the image cannot be displayed, users still receive the description.


Label Form Inputs

Bad:

<input type="email">

Good:

<label for="email">
    Email
</label>

<input
    id="email"
    type="email">

Labels improve accessibility and help screen readers correctly announce form fields.


Support Keyboard Navigation

Not every user uses a mouse.

Users should be able to navigate using:

  • Tab
  • Shift + Tab
  • Enter
  • Space

For example:

<button>
    Submit
</button>

Buttons are keyboard accessible by default.


Use Proper Heading Structure

Bad:

<h1>Main Title</h1>
<h4>Section</h4>

Good:

<h1>Main Title</h1>
<h2>Section</h2>
<h3>Subsection</h3>

Logical heading order helps both users and screen readers understand page structure.


Maintain Good Color Contrast

Bad:

Light Gray Text
on
White Background

Good:

Black Text
on
White Background

Good contrast makes content easier to read.


Accessibility Testing Tools

Popular accessibility tools include:

  • Lighthouse
  • WAVE
  • Axe DevTools

These tools help identify accessibility issues during development.


Semantic HTML for Accessibility

Semantic HTML is one of the easiest ways to improve accessibility.

Non-semantic example:

<div class="header"></div>

<div class="nav"></div>

<div class="footer"></div>

Semantic example:

<header></header>

<nav></nav>

<footer></footer>

Screen readers immediately recognize the purpose of semantic elements.

Common semantic elements include:

Element Purpose
header Page Header
nav Navigation
main Main Content
section Content Section
article Independent Content
aside Related Content
footer Footer

Example:

<header>
    Website Name
</header>

<nav>
    Menu
</nav>

<main>

    <section>
        Content
    </section>

</main>

<footer>
    Copyright
</footer>

Accessible Images

Bad:

<img src="hero.jpg">

Good:

<img
    src="hero.jpg"
    alt="Students learning web development">

Always describe meaningful images.


Accessible Forms

Bad:

<input type="text">

Good:

<label for="name">
    Name
</label>

<input
    id="name"
    type="text">

Always associate labels with form controls.


SEO Basics

SEO stands for Search Engine Optimization.

Its goal is to improve a website's visibility in search engines.

Without SEO:

Website
    ↓
Nobody Finds It

With SEO:

Website
    ↓
Google Finds It
    ↓
Users Visit It

How Search Engines Work

Search engines generally follow three steps.

1. Crawling

Search engines discover webpages.

Google Bot
      ↓
Visits Website

2. Indexing

The page is stored in Google's database.

Website
      ↓
Google Index

3. Ranking

Google decides where pages appear in search results.

Best Results
Appear Higher

SEO Best Practices

Use Meaningful Titles

Bad:

<title>Home</title>

Good:

<title>
    Learn HTML & CSS - Complete Guide
</title>

Use Meta Descriptions

<meta
    name="description"
    content="Learn HTML and CSS from beginner to advanced.">

Search engines may display this description in search results.


Use Semantic HTML

Bad:

<div>
    Article Content
</div>

Good:

<article>
    Article Content
</article>

Semantic elements help search engines understand content.


Use Proper Headings

<h1>Frontend Development</h1>

<h2>HTML Basics</h2>

<h3>Tags</h3>

A clear heading hierarchy improves readability and SEO.


Optimize Images

Bad:

<img src="image.jpg">

Good:

<img
    src="image.jpg"
    alt="Frontend Development Roadmap">

Benefits:

  • Better Accessibility
  • Better SEO

Build Mobile-Friendly Websites

Responsive websites perform better in search results.

Google prioritizes mobile-friendly pages.


Improve Loading Speed

Slow websites rank lower.

Improve performance by:

  • Compressing images
  • Using WebP images
  • Lazy loading images
  • Minifying CSS and JavaScript

Use HTTPS

Bad:

http://example.com

Good:

https://example.com

Secure websites are preferred by search engines.


Use SEO-Friendly URLs

Bad:

example.com/page?id=123

Good:

example.com/html-basics

Readable URLs are better for both users and search engines.


Sitemap

A sitemap helps search engines discover pages.

Example:

sitemap.xml

It may include:

  • Home
  • About
  • Blog
  • Contact

robots.txt

The robots.txt file controls which pages search engines can crawl.

Example:

robots.txt

Accessibility and SEO Together

Many accessibility improvements also improve SEO.

Accessibility SEO Benefit
Semantic HTML Better Content Understanding
Alt Text Better Image SEO
Proper Headings Better Structure
Fast Loading Better Rankings
Mobile-Friendly Design Better Rankings

Real-World Example

<!DOCTYPE html>

<html lang="en">

<head>

    <title>
        Frontend Development Guide
    </title>

    <meta
        name="description"
        content="Learn frontend development from beginner to advanced.">

</head>

<body>

<header>
    <h1>Frontend Development</h1>
</header>

<nav>
    Navigation
</nav>

<main>

    <article>

        <h2>HTML Basics</h2>

        <img
            src="html.jpg"
            alt="HTML Tutorial">

        <p>
            Learn HTML fundamentals.
        </p>

    </article>

</main>

<footer>
    © 2026
</footer>

</body>

</html>

Key Takeaway

A professional website should be:

Accessible
      +
Semantic
      +
Fast
      +
Mobile Friendly
      +
SEO Optimized

By using semantic HTML, meaningful headings, alt text, labels, responsive design, and SEO best practices, you create websites that are easier for both people and search engines to understand.

2.7 Semantic HTML3.1 CSS Introduction