Every browser shipped a standards mode in the late 1990s and early 2000s. To avoid breaking the half of the web written before it, they also shipped the old one.
How a rendering engine ends up with two personalities
When the W3C published CSS2 and the HTML 4.01 specification in the late 1990s, browser vendors faced an uncomfortable truth: millions of pages had been written against the inconsistent, undocumented behaviours of Netscape 4 and Internet Explorer 4 and 5. Those pages used the old box model, where width and height included padding and border rather than excluding them. They relied on proprietary extensions. They assumed bugs. Rendering them correctly under the new specifications would have made them look wrong.
Tantek Çelik, who worked on Internet Explorer 5 for Mac, is credited with devising the practical solution that became universal: use the DOCTYPE declaration to switch modes. A page that opened with a proper standards DOCTYPE got the new, specification-compliant renderer. A page that lacked one, or that used an incomplete or obsolete DOCTYPE, got the old behaviour — quirks mode — in which the engine would approximate what the chaotic 1990s browsers had done. Internet Explorer 5 for Mac shipped this in 2000; Internet Explorer 6 for Windows followed, and the other vendors converged on the same convention.
The name is accurate. Quirks mode does not implement a different specification; it implements the accumulated idiosyncrasies that preceded one. The most consequential is the box model: in quirks mode, a CSS width declaration includes padding and border. In standards mode, it does not. This distinction alone was responsible for an enormous amount of layout breakage when the switchover arrived, and it is why the CSS box-sizing property, decades later, defaults to the standards behaviour but is routinely set back to border-box — the quirks-mode interpretation that many developers find more intuitive. The irony embedded in that one CSS declaration is considerable.
Key moments in the timeline
- Late 1990sW3C publishes CSS2 and HTML 4.01; the standards/legacy problem becomes acute
- 2000Internet Explorer 5 for Mac ships DOCTYPE-triggered mode switching, credited to Tantek Çelik
- 2001IE6 for Windows ships the same mechanism; other vendors converge on the convention
- Mid-2000sMozilla formalises "almost-standards mode" as a narrow intermediate state
- 2014HTML5 specification codifies quirks-mode behaviour as normative text;
<!DOCTYPE html>becomes the canonical trigger
The trigger, the in-between state, and what actually ships
The DOCTYPE mechanism produced an unexpected intermediate category. Some pages had a DOCTYPE, but one that was old enough or malformed enough that browsers could not confidently place them in either camp. Mozilla introduced a third state, called almost-standards mode, to handle the handful of cases — chiefly table cell height handling — where a narrow set of quirks was preserved for otherwise standards-compliant documents. Most working front-end developers have never had occasion to think about almost-standards mode. It exists, it works, and it is a sign of how granular the backward-compatibility problem actually was.
The HTML5 specification eventually codified all of this with unusual candour. Rather than pretending the old behaviour had never existed, the WHATWG wrote the rules for quirks mode directly into the standard, specifying which behaviours a compliant browser must preserve when it encounters a legacy document. The DOCTYPE trigger was simplified: <!DOCTYPE html>, the shortest valid form, became the reliable way to request standards mode. For the first time there was a DOCTYPE simple enough that developers would actually type it from memory.
Modern browsers still carry all three modes. They are not vestigial — the web relies on documents that have not changed since the early 2000s, and those documents must still render adequately. Archive projects, legacy intranets, government forms and small institutional sites continue to exist in their original form. The commitment to backward compatibility that drove the two-mode design in 2000 is the same commitment that means it has never been removed.
The box model split
- Quirks mode
widthincludes padding and border (the old Netscape/IE behaviour) - Standards mode
widthexcludes padding and border (the W3C specification) box-sizing: border-boxthe CSS property that lets modern code opt back into the quirks-mode calculation, now widely used by default in stylesheets
This arrangement illuminates something fundamental about web standards as a practice. The bodies that write specifications — the W3C, the WHATWG, TC39 for JavaScript — do not control deployment. They cannot deprecate a behaviour by removing it from a document; they can only define what new documents should do. Everything that ever shipped and was relied upon accumulates in the engine. Quirks mode is the most visible proof of that principle, but it is far from the only instance. The browsers-disagreed era left traces in every layer of the stack, and the rendering engine carries the deepest ones: two modes, still live, because the alternative was breaking half the web on the day standards arrived.