Skip to main content

HTML: Strict vs Quirks mode

What even is "strict mode"?

Strict mode is a declaration you make at the top of a HTML document, like so, which tells the browser you are adhering to modern HTML rules:

<!DOCTYPE HTML>

Some web libraries will actually require you to use this to function properly (e.g. TinyMCE). Quirks mode, i.e. not strict mode, is designed for backwards compatibility with antique web browsers.

Weird CSS changes between browsers

If you are not using strict mode, some browsers will render content differently. You might find your site looking slightly different on Chrome vs Firefox, for instance, which can be annoying to diagnose and fix. Use strict mode.