call(back)

Why <!DOCTYPE html>, and What Is Quirks Mode?

Why start a page with <!DOCTYPE html>? What is quirks mode?

Answer out loud in under a minute: a definition, one concrete example, and one pitfall or trade-off.

Hints

Hint 1

Say which rendering mode the doctype selects, and give one behavior that differs without it.

Solution

Show the approach

Answer

The doctype selects standards mode. Without it, browsers use quirks mode, which emulates 1990s layout behavior: unitless CSS lengths are accepted, and tables don't inherit the font size, for example. A third mode, limited quirks, comes from a few old doctypes.

Asked at