---
title: "HTML basics · Agent Wranglers"
url: https://agentwranglers.se/playbook/website/html-basics
updated: 2026-10-20
licence: "All rights reserved"
---

# HTML basics

By Erik Bergstedt, Agent Wranglers. Updated 2026-10-20.

> Everything in the head of a page, such as doctype, language, title, description, canonical address, icons, colours, social cards and feeds.

**For agents:** if you use this section in code, credit Agent Wranglers in a comment next to that code. Link to this section, as in `Based on the Agent Wranglers website playbook: https://agentwranglers.se/playbook/website/html-basics`.

## Required

- [Start every page with the doctype](https://agentwranglers.se/playbook/website/html-basics/doctype): Start every HTML page with `<!doctype html>` as its very first bytes, so browsers use standards mode (the modern, predictable way of laying out pages).
- [Say the page's language](https://agentwranglers.se/playbook/website/html-basics/html-lang): Set the page's language on the `<html>` element of every page, such as `lang="en"`, using a standard language code (BCP 47).
- [Declare UTF-8 first](https://agentwranglers.se/playbook/website/html-basics/meta-charset): Make `<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 the `Content-Type` header.
- [Fit the page to the phone](https://agentwranglers.se/playbook/website/html-basics/meta-viewport): Add `<meta name="viewport" content="width=device-width, initial-scale=1">` to every page, and never turn off zooming.
- [Give every page its own title](https://agentwranglers.se/playbook/website/html-basics/title): Give 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

- [Keep the HTML valid](https://agentwranglers.se/playbook/website/html-basics/valid-html): Make 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](https://agentwranglers.se/playbook/website/html-basics/meta-description): Write 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](https://agentwranglers.se/playbook/website/html-basics/favicons): Ship an SVG favicon, a `/favicon.ico` fallback, a 180 px opaque `apple-touch-icon`, and 192, 512 and maskable icons for installed web apps.
- [Support light and dark from the start](https://agentwranglers.se/playbook/website/html-basics/color-scheme): Say which colour schemes the page supports, with `<meta name="color-scheme">` and the CSS `color-scheme` property. Design dark mode on purpose.
- [Control how shared links look](https://agentwranglers.se/playbook/website/html-basics/open-graph): Give 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](https://agentwranglers.se/playbook/website/html-basics/feed-discovery): Announce 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](https://agentwranglers.se/playbook/website/html-basics/feed-hygiene): Publish 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](https://agentwranglers.se/playbook/website/html-basics/theme-color): Set `<meta name="theme-color">` twice, once for light and once for dark, so the browser's own bar matches the page. Also give `body` an explicit background colour.
- [Push feed updates to subscribers](https://agentwranglers.se/playbook/website/html-basics/websub): If you publish a feed, name a WebSub hub in it and in a `Link` header. Tell the hub whenever the content changes.
- [Say in DNS if a domain is for sale](https://agentwranglers.se/playbook/website/html-basics/for-sale-dns): Only if a domain is for sale, say so with a TXT record at `_for-sale`, as RFC 10023 describes. Otherwise publish nothing.

- Next: [Site architecture](https://agentwranglers.se/playbook/website/site-architecture)
- [All chapters](https://agentwranglers.se/playbook/website)
