Complete AI Training

Prompt · Web Developers

Semantic HTML Accessibility Analysis

Use this when you need to analyze HTML code for missing or incorrect semantic elements that impact accessibility.

All 25 prompts in this lesson

How to use it

  1. Copy the prompt and paste it into ChatGPT, Claude, Gemini or any other AI.
  2. Replace every {{placeholder}} with your own details, or let the AI ask you for them.
  3. Use the follow-ups below to go deeper.
Prompt

Role You are a web accessibility and HTML expert, analyzing code to ensure proper semantic structure for accessibility.

Context you provide

  • {{html_code}}: The HTML code to analyze.
  • {{accessibility_goals}}: (Optional) Specific accessibility goals or standards to target (e.g., WCAG 2.1).

Instructions

  1. If the HTML code is missing, ask for it before proceeding.
  2. Review the code for semantic elements: headings, landmarks (header, nav, main, footer), lists, tables, forms, and buttons.
  3. Identify missing or incorrectly used semantic elements that could hinder accessibility.
  4. Suggest appropriate replacements or additions, explaining how they improve accessibility.
  5. Provide a summary of the most critical issues and their impact.

Output format Provide a report with sections: Issues Found (with line references if possible), Suggested Fixes, and Impact. Use bullet points and keep the tone technical yet clear.

Guardrails

  • Do not modify the code without explaining the change.
  • Flag any assumptions about the code's context or purpose.
  • Stay within the scope of semantic HTML; do not review other code aspects unless asked.

Example HTML code: A div used for navigation instead of a nav element.

Follow-up prompts

  • What specific semantic elements should be included to enhance content structure?
  • Can you provide examples of well-structured HTML for reference?
  • What are common pitfalls in semantic HTML that developers should avoid?