Browser Modes with Doctype

This lesson will help us understand what the quirks and standards modes are. Let's begin!

Older versions of several web browsers did not conform to the web standards for CSS. Authors created web pages that used several browser-specific quirks to render pages the way they intended. To render the websites created using these quirks, modern web browsers implement several rendering modes, including a quirks mode.

Quirks vs. standards mode

The layout engines in web browsers have three modes: quirks mode, almost standards mode, and full standards mode.

The DOCTYPE tag makes the browser render a particular page in the standards mode, where the page is rendered according to the CSS specifications. In full standards mode, HTML and CSS specifications describe the behavior. A very few quirks are implemented in the almost standards mode.

Quirks mode is used if the browser finds an outdated or missing DOCTYPE at the start of the page, which is more backward compatible with old practices and old browsers. The layout emulates nonstandard behavior, which is essential to support websites built before the widespread adoption of web standards.

Level up your interview prep. Join Educative to access 70+ hands-on prep courses.