Semantic HTML5, SEO fundamentals, alt texts, progressive enhancement, SPA considerations, device capability detection, and user context awareness. Good HTML is the foundation of accessibility, SEO, and resilient UI. Use when building any web UI, reviewing markup quality, or optimising for search and accessibility.
Installation
Installer avec Codex ou Claude Copiez ce prompt, collez-le dans Codex, Claude ou un autre assistant, puis laissez-le vérifier la page du skill et l'installer pour vous.
Semantic HTML5, SEO fundamentals, alt texts, progressive enhancement, SPA considerations, device capability detection, and user context awareness. Good HTML is the foundation of accessibility, SEO, and resilient UI. Use when building any web UI, reviewing markup quality, or optimising for search and accessibility.
metadata
{"priority":8,"pathPatterns":["**/*.html","**/*.tsx","**/*.jsx","**/*.vue","**/*.svelte","app/**","pages/**","src/**"],"promptSignals":{"phrases":["seo","semantic html","alt text","meta tags","progressive enhancement","spa","open graph","structured data","html5","localstorage","sessionstorage","personalization","remember user preference"]}}
retrieval
{"aliases":["seo","semantic html","alt text","progressive enhancement","html5 best practices","meta tags","open graph","structured data","spa seo","client-side storage","localStorage personalization"],"intents":["improve seo","add alt texts","write semantic html","optimise for search engines","add open graph tags","make spa crawlable","persist user preferences client-side","personalise based on stored state"],"examples":["add proper meta tags to this page","write semantic html for this component","how do I make this SPA SEO friendly","add alt texts to all images","remember the user's last view with localStorage","personalise this returning-user experience"]}
Semantic HTML and SEO
Good HTML is not just markup — it is the contract between your content, search engines, assistive technologies, and the browser. Semantic HTML, correct metadata, and progressive enhancement make UI resilient, findable, and accessible by default.
Semantic HTML5
Use the element that describes the content's meaning, not just its appearance.
Document structure
<header><!-- site header, logo, primary nav --><nav><!-- navigation links --><main><!-- primary page content, one per page --><article><!-- self-contained content: blog post, product card, news item --><section><!-- thematic grouping with a heading --><aside><!-- tangentially related content: sidebar, callout --><footer><!-- site footer, secondary links, copyright -->
Headings
One <h1> per page — the primary topic. Headings form an outline: do not skip levels (h1 → h3 without h2).
<button><!-- clickable action, submits or triggers JS --><ahref><!-- navigation to a URL --><input><!-- user data entry --><select><!-- option selection --><details> / <summary><!-- native disclosure/accordion -->
Never use <div> or <span> as interactive elements without full ARIA annotation — and even then, prefer the native element.
Images and Alt Text
Every <img> needs an alt attribute. What goes in it depends on context.
<title>Product Name — Short descriptor | Brand</title><metaname="description"content="One or two sentences. What this page is, who it is for, what they will find.">
Title: 50–60 characters. Most important keyword first.
Description: 120–160 characters. Shown in search results — write for the human, not the algorithm.
Common types: Product, Article, BreadcrumbList, FAQPage, Organization, SiteLinksSearchBox.
Progressive Enhancement
Build in layers. The core content and function must work without JavaScript. Enhance with CSS. Enhance further with JS.
Layer 1: HTML — content is readable, links work, forms submit
Layer 2: CSS — layout, typography, visual design
Layer 3: JS — interactivity, animations, dynamic content
In practice:
Forms must submit via native <form action> without JS — JS can intercept and enhance with fetch
Navigation links must be real <a href> — JS can add transitions
Content must be in the HTML — JS can enhance with lazy-load or personalisation
Images must have src — JS can add lazy loading via loading="lazy" (now native)
SPA Considerations
Single-page applications break browser defaults that SEO and accessibility depend on. Fix them explicitly.
Server-side rendering or static generation
Client-rendered HTML is not reliably indexed by search engines. Use SSR (Next.js, Nuxt, SvelteKit) or static generation for any content that needs to be found.
Title and meta updates
Update document.title and meta tags on every route change. Use the framework's <Head> component or equivalent.
Focus management
On route change, move focus to the new page's <h1> or <main> — screen readers do not detect SPA navigation automatically.
// After route changedocument.querySelector('h1')?.focus();
Scroll restoration
Restore scroll position to top on navigation, or to the saved position on back navigation. Browser default scroll restoration is disabled in SPAs.
History API
Use pushState / replaceState so back/forward navigation and bookmarking work correctly.
Device Capabilities and User Context
Design and code should adapt to what the device and user can actually do.
Client-side storage as a personalization tool
localStorage, sessionStorage, and other browser capabilities (cookies, IndexedDB, media/permission queries) are legitimate tools for tailoring the experience — last view mode, chosen locale, a dismissed banner, an in-progress draft, a returning user's context.
Guardrails:
Personalise from real understanding, not a guess. What to persist and pre-fill safely usually needs customer testing — a wrong assumption in stored state is worse than a neutral default.
Scope and consent.sessionStorage for one session, localStorage across sessions; never store anything sensitive client-side; honour consent.
Re-validate every 2–3 years. Needs drift; a personalization that fit at launch becomes friction. Revisit, ideally with fresh testing.
<!-- Lazy load images below the fold --><imgsrc="product.jpg"loading="lazy"alt="..."><!-- Serve modern formats with fallback --><picture><sourcesrcset="image.avif"type="image/avif"><sourcesrcset="image.webp"type="image/webp"><imgsrc="image.jpg"alt="..."></picture>