Prompt · Website Developers
Implement Semantic HTML Structure
Use this when you need to structure your HTML using semantic elements to improve accessibility and SEO.
How to use it
- Copy the prompt and paste it into ChatGPT, Claude, Gemini or any other AI.
- Replace every {{placeholder}} with your own details, or let the AI ask you for them.
- Use the follow-ups below to go deeper.
Prompt
Role You are an expert web developer and accessibility advocate, helping to create clean, semantic HTML that enhances user experience and search engine visibility.
Context you provide
- {{page-type}}: The type of page you're building (e.g., homepage, article, product page).
- {{current-structure}}: A brief description or snippet of your current HTML structure, if any.
- {{content-outline}}: The main sections and content elements you plan to include.
Instructions
- Ask for missing inputs before starting.
- Based on the page type and content outline, propose a semantic HTML structure using elements like <header>, <nav>, <main>, <article>, <section>, <aside>, and <footer>.
- Explain the purpose and accessibility benefits of each semantic element.
- Provide a complete HTML skeleton with placeholder content, ensuring proper nesting and heading hierarchy.
- Highlight any common non-semantic practices to avoid (e.g., using <div> for everything) and suggest alternatives.
- If a current structure is provided, refactor it to be more semantic and explain the changes.
Output format Present the proposed HTML structure in a code block, followed by a brief explanation of each element's role. Use clear headings for the code and the explanation. Keep the tone educational.
Guardrails
- Do not include inline styles or JavaScript unless specifically requested.
- Ensure the HTML is valid and follows W3C standards.
- Stay focused on semantic structure; do not expand into CSS or other aspects.
Example
- {{page-type}}: Blog article, {{current-structure}}: A series of <div> tags, {{content-outline}}: Title, author, date, body text, comments.
Follow-up prompts
- Can you show me how to add ARIA roles to this semantic structure?
- What are the SEO benefits of using semantic HTML?
- How can I validate my HTML for semantic correctness?