|
Quirks mode refers to a technique used by some web browsers to maintain backwards compatibility with web pages designed for older browsers. Icons for Web browser shortcuts on an Apple computer (Safari, Internet Explorer, and Firefox). ...
A webpage or web page is a page of the World Wide Web, usually in HTML/XHTML format (the file extensions are typically htm or html) and with hypertext links to enable navigation from one page or section to another. ...
Overview
Web pages are produced using two languages: HTML, a markup language designed for web use, describes the structure and content of a page, and Cascading Style Sheets (CSS), a generalized stylesheet language, specifies how the page should be rendered in various media (visual styles for screen display, print styles to use when printing the page, aural styles to use when the page is read aloud by a screen reader, etc.). However, the implementations of these languages in web browsers, particularly implementations of CSS, were at first minimal and known to contain many bugs or "quirks". Compounding this problem, many web page authors did not refer to the existing specifications for these languages to find workarounds, and instead used the (incorrect) renderings of then-current web browsers as a baseline of "correct" behavior. An excerpt of HTML code with syntax highlighting In computing, HyperText Markup Language (HTML) is a markup language designed for the creation of web pages with hypertext and other information to be displayed in a web browser. ...
Wikibooks programming has more about this subject: CSS In computing, Cascading Style Sheets (CSS) is a stylesheet language used to describe the presentation of a document written in a markup language. ...
CSS Zen garden with the Paravion style sheet CSS Zen garden with the Uncultivated style sheet Cascading Style Sheets (CSS) is a computer language used to describe the presentation of a structured document written in HTML, XHTML or XML. The CSS specification is maintained by the World Wide Web Consortium...
A screen reader is a software application that attempts to identify and interpret what is being displayed on the screen. ...
The result is that, although browser support for standards-conformant rendering of HTML and CSS has improved dramatically, there exist a large number of web pages which assume the existence of older browsers' bugs and will not render in a standards-conformant browser as the author intended. These typically fall into two broad categories: "legacy" pages that pre-date the common use of web standards – many of which are no longer maintained by their authors – and newer pages that are created by authors who are unaware of web standards, as an understanding of them is not required to produce a working web page.
Quirks mode, standards mode, and almost-standards mode To work around this problem and maintain compatibility with the greatest possible number of web pages, web browser developers generally design their software to use either of two rendering modes: in "standards mode" pages are rendered according to the HTML and CSS specifications, while in "quirks mode" attempts are made to emulate the behavior of older browsers, in order to ensure that these pages render as their authors intended. Some browsers (those based on Mozilla's Gecko rendering engine, for example), also use an "almost standards" mode which attempts to compromise between the two, emulating some older quirks while mostly conforming with the specifications. Most often, browsers determine which rendering mode to use based on the presence of a Document Type Declaration in the page; if a full DOCTYPE is present, the browser will use standards mode, and if it is absent the browser will use quirks mode. For example, a web page which began with the following DOCTYPE would trigger standards mode: A Document Type Declaration, or DOCTYPE, associates a particular SGML or XML document with a Document Type Definition (DTD). ...
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/DTD/strict.dtd"> While this DOCTYPE (which does not contain either the version of HTML in use, or the URL of an HTML Document Type Definition), would trigger quirks mode: A Uniform Resource Locator, URL (spelled out as an acronym, not pronounced as earl), or Web address, is a standardized address name layout for resources (such as documents or images) on the Internet (or elsewhere). ...
Document Type Definition (DTD), defined slightly differently within the XML and SGML specifications, is one of several SGML and XML schema languages, and is also the term used to describe a document or portion thereof that is authored in the DTD language. ...
<!DOCTYPE html PUBLIC> Additionally, a web page which does not include a DOCTYPE at all will render in quirks mode. One notable exception to this is Microsoft's Internet Explorer 6 browser, which will render a page in quirks mode if the DOCTYPE is preceded by an XML declaration, regardless of whether a full DOCTYPE is specified. Thus an XHTML page which begins with the following code would be rendered in quirks mode by IE 6: Microsoft Corporation (NASDAQ: MSFT, HKSE: 4338) is an international computer technology corporation with 2005 global annual sales of US$42. ...
Internet Explorer, abbreviated IE or MSIE, is a proprietary graphical web browser made by Microsoft and included as part of the Microsoft Windows line of operating systems. ...
The Extensible Markup Language (XML) is a W3C-recommended general-purpose markup language for creating special-purpose markup languages, capable of describing many different kinds of data. ...
The Extensible HyperText Markup Language, or XHTML, is a markup language that has the same expressive possibilities as HTML, but a stricter syntax. ...
<?xml version="1.0" encoding="utf-8"?> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> Microsoft's Chris Wilson has indicated that the problem with the XML declaration will be fixed in version 7 of Internet Explorer, in which the XML prolog will simply be ignored [1] For maximum compatibility with existing and older web browsers, the World Wide Web Consortium, which maintains the XHTML specification, generally recommends that authors of XHTML pages omit the XML declaration[2]. To meet Wikipedias quality standards, this article or section may require cleanup. ...
Internet Explorer 6 will also render HTML 4 pages with a DOCTYPE in quirks mode if a URL for the DTD is not provided. In addition some browsers have an "almost standards mode", which implements all but the most painful of strict mode rules [3].
Examples of differences between quirks mode and standards mode One prominent difference between quirks and standards modes the handling of the CSS box model in Microsoft's Internet Explorer browser. Before version 6, Internet Explorer used an algorithm for determining the width of an element's box which conflicted with the algorithm detailed in the CSS specification, and due to Internet Explorer's popularity many pages were created which relied upon this incorrect algorithm. As of version, 6, Internet Explorer uses the CSS specification's algorithm when rendering in standards mode and uses the previous, non-standard algorithm when rendering in quirks mode. Another notable difference is the vertical alignment of certain types of inline content; many older browsers aligned images to the bottom border of the cell, although the CSS specification requires that they be aligned to the baseline of the text within the cell. In standards mode, Gecko-based browsers will align to the baseline, and in quirks mode they will align to the bottom of the cell[4]. Many developers solve with issue with a CSS declaration to force block alignment for all images: img {display: block}. Gecko is the open source web browser layout engine used in all Mozilla-branded software and its derivatives, including later Netscape releases. ...
Additionally, many older browsers did not implement inheritance of font styles within tables; as a result, font styles had to be specified once for the document as a whole, and again for the table, although the CSS specification requires that font styling be inherited into the table. This creates a compatibility problem, since a page which relies on the older behavior, and also uses relative font sizing, could render with fonts much smaller than expected in tables [5].
Verifying which rendering mode is in use In Mozilla Firefox, the "Page Information" dialog box will indicate the rendering mode in use for a given page. In Internet Explorer, the JavaScript property document.compatMode indicates the rendering mode for the current page -- in standards mode, document.compatMode contains the value 'CSS1Compat', while in quirks mode it contains the value 'BackCompat'[6]. Mozilla Firefox is a free, open source, cross-platform, graphical web browser developed by the Mozilla Corporation and hundreds of volunteers. ...
See also The difference between the World Wide Web Consortiums width and Internet Explorers width of a block-level element The Internet Explorer box model bug is one of the best-known bugs in a popular implementation of Cascading Style Sheets (CSS). ...
External links |