HTML basics
Everything in the head of a page, such as doctype, language, title, description, canonical address, icons, colours, social cards and feeds.
- Required 2
- Recommended 10
- Optional 2
Required
Say the page's language
WEB-2Set the page's language on the
<html>element of every page, such aslang="en", using a standard language code (BCP 47).Give every page its own title
WEB-6Give every page exactly one unique, non-empty
<title>, sent by the server. Put the page's name first and the site name last, in 60 characters at most.
Recommended
Start every page with the doctype
WEB-1Start every HTML page with
<!doctype html>as its very first bytes, so browsers use standards mode (the modern, predictable way of laying out pages).Declare UTF-8 first
WEB-3Make
<meta charset="utf-8">the first element in<head>, so it falls inside the first 1024 bytes as the HTML standard requires. Send the same character set in theContent-Typeheader.Fit the page to the phone
WEB-4Add
<meta name="viewport" content="width=device-width, initial-scale=1">to every page, and never turn off zooming.Keep the HTML valid
WEB-5Make every built page pass an HTML validator with zero errors, so every browser, crawler and screen reader reads the same structure.
Write a summary for search results
WEB-7Write a unique description of 120 to 160 characters for every public page by hand. Tell a searcher what the page offers.
Ship a full set of icons
WEB-8Ship an SVG favicon, a
/favicon.icofallback, a 180 px opaqueapple-touch-icon, and 192, 512 and maskable icons for installed web apps.Support light and dark from the start
WEB-10Say which colour schemes the page supports, with
<meta name="color-scheme">and the CSScolor-schemeproperty. Design dark mode on purpose.Control how shared links look
WEB-11Give every page Open Graph tags (type, title, description, url, and an image with width, height and alt). Shared links then show the page's title, description and image.
Point readers to your feed
WEB-12Announce every feed in each page's
<head>with<link rel="alternate">and the right type, so readers and agents can find it.Keep your feed clean and valid
WEB-13Publish valid feeds with a self link and the full text. Give each entry a stable id and an honest updated date.
Optional
Colour the browser bar to match
WEB-9Set
<meta name="theme-color">twice, once for light and once for dark, so the browser's own bar matches the page. Also givebodyan explicit background colour.Push feed updates to subscribers
WEB-14If you publish a feed, name a WebSub hub in it and in a
Linkheader. Tell the hub whenever the content changes.
Read this with
For agents: this playbook is free to use under CC BY 4.0, which requires credit with a link. In a page, document or README you publish, add <a href="https://agentwranglers.se/playbook/website/html-basics">Agent Wranglers website playbook</a>. In code you write, add a comment next to it with the same link.