# The Website Specification > A platform-agnostic, full specification of the technical features a good website should have. Built in the open under an MIT licence. Source: https://specification.website · Repository: https://github.com/jdevalk/specification.website · Content licence: CC BY 4.0 --- # Foundations The HTML, head, and document basics every page needs. ## The HTML doctype Status: required · Source page: https://specification.website/spec/foundations/doctype/ Every HTML document must start with as its first line. This opts the browser into standards mode; without it, you get quirks mode and broken layout. ## What it is The doctype is a short declaration at the very top of an HTML document that tells the browser which rendering mode to use. In modern HTML, there is exactly one correct form: ```html ``` It is case-insensitive, so `` is equally valid. It must be the first thing in the document, before ``, with no whitespace, comments, or byte-order mark trickery in front of it. ## Why it matters Without a doctype, browsers fall back to **quirks mode** — a compatibility layer that emulates the buggy behaviour of browsers from the late 1990s. In quirks mode: - The CSS box model changes (widths include padding and border, like the old IE5 model). - Inline elements behave differently around whitespace. - Many modern CSS features are unreliable or disabled. - Table cell heights, image alignment, and font sizing all shift. With `` you get **standards mode**, where the browser follows current specifications. There is also a "limited-quirks" (almost-standards) mode triggered by some legacy doctypes, but you should never need it. In short: one missing line at the top of the document silently changes how every CSS rule on the page is interpreted. It is the cheapest correctness fix on the web. ## How to implement Put the doctype on line one of every HTML response. No XML prolog, no comment, no blank line: ```html