Quirks mode

from Wikipedia, the free encyclopedia

The Quirks mode (from English "quirk" = Eigenart, Macke) is a compatibility mode in various programs that simulates errors in earlier versions or comparable programs.

Quirks modes in web browsers

The most important quirks modes can be found in the current web browsers . These are intended to ensure backward compatibility with websites that use outdated or invalid HTML , JavaScript or CSS code. Thereby u. a. Display errors of older browser versions are simulated so that the layout of these websites is not destroyed. For example, Internet Explorer 9 simulates Internet Explorer 5 in quirks mode . Quirks mode is necessary above all because only a few websites adhere to the W3C standards: Many pages have been developed for Internet Explorer or an older Netscape Navigator . These browsers sometimes interpret the standards incorrectly. Modern browsers that support the current standards would display these pages correctly, but not as desired. The quirks mode often makes it possible to display these pages that are actually faulty.

All modern browsers align the display mode according to the document type definition (doctype) in the HTML source code. If the doctype is missing, the quirks mode is used.

Among other things, the following document type definitions cause a page to be displayed using standard-compliant mode (Strict):

<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN"
"http://www.w3.org/TR/html4/strict.dtd">
<!-- HTML 4.01 mit URI -->
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN">
<!-- HTML 4.01 ohne URI -->
<!DOCTYPE html>
<!-- HTML allgemein (ab Version 5, aber rückwärtskompatibel mit alten Browsern) -->

Microsoft's Internet Explorer recognizes in version 6 with strictly according to the rules of the W3C designed XHTML -documents the document type definition not and go into quirks mode. Such documents contain the XML declaration with elementary information on the character set used in the first line instead of the document type definition, as the browser erroneously expected. This can cause these documents to be displayed incorrectly.

The quirks mode is the counterpart to the standard-compliant mode . Some browsers also have an Almost Standard mode , which is essentially based on the standards, but simulates some errors with particularly serious effects.

Quirks modes in other programs

The Turbo Assembler had a quirks mode in which bugs the widespread MASM of Microsoft were simulated.

Web links

Individual evidence

  1. blogs.technet.com