Modern browsers use up to three display modes to accommodate various levels of non-compliance in the pages they encounter. Standards mode almost matches current Web standards. Some browsers include an almost-standards mode that departs from standards mode only its handling of images placed in table cells. Quirks mode maintains compatibility with Internet Explorer 5.5. The trigger for these modes comes from the DOCTYPE declaration, or lack thereof, at the beginning of the Web page.
When a Web browser operates in quirks mode, it relaxes its compliance with current Web standards to accommodate Web pages for compatibility with older browsers. Many of these pages come from websites designed and uploaded before modern standards existed. In those earlier days, Web designers exploited the quirks displayed by specific browsers so they could accomplish design objectives, or worked around those quirks to create the look they wanted. To render these pages correctly, modern browsers use quirks mode.
Types of Display Modes
Web pages begin with a Document Type Declaration, or DOCTYPE, that tells the browser what type of encoding the page uses. Older Web pages lack modern DOCTYPE statements or use DOCTYPE syntax that complies with the standards that existed when a designer created them. When a modern browser reads a page and discovers it lacks a DOCTYPE statement, or uses a statement that doesn't match modern standards, the browser uses quirks mode to parse the page and display it as its designer intended it.
Some old browsers refused to apply the font properties declared for a Web page to tables that appeared on the page. As a result, Web designers had to encode the font information into the table as well, or allow the browser's font defaults to apply to the table at 80 percent of the size stated in the browser's preferences. Encoding font information twice into the same page violates modern standards. These kinds of encodings also trigger quirks mode.
Web pages load faster and more smoothly when they're developed in adherence with modern HTML and CSS standards. Relying on quirks mode to render old pages and sites correctly runs the risk that as browser standards advance, support for legacy code will fall by the wayside, leaving pages to display incorrectly, if at all. If your website relies on quirks mode, consider refreshing it with modern, compliant code -- and redesigning it to give it a new look with up-to-date content.
- Photo Credit Hemera Technologies/Photos.com/Getty Images