This example demonstrates how to use the compatMode property to retrieve information indicating whether standards-compliant mode is switched on. Click the Check Mode button to display the value of the compatMode property of this document.
The style rule for this P element conforms to the CSS1 specification. This style applies whether or not the !DOCTYPE declaration in the document switches on standards-compliant mode.
The style rules for this P element do not conform to the CSS1 specification because the keyword tokens "red" and "solid" are inside quotation marks. The style rules are ignored when the !DOCTYPE declaration switches on standards-compliant mode.
If the preceding paragraph is surrounded by a solid border and the text is red, standards-compliant mode is not switched on—the browser is in BackCompat mode. If the paragraph does not have a solid border and the text is not red, standards-compliant mode is switched on—the browser is in CSS1Compat mode.
[Right-click and choose View Source from the shortcut menu.]
© 2007 Microsoft Corporation. All rights reserved. Terms of use.