Many Mambo templates were designed to run in quirks mode under Internet Explorer 6. This tutorial explains how to reduce compatibility problems with Internet Explorer 7.
IE6 gave template designers the option to render their sites in either standards mode or what is called quirks mode. Quirks mode is a backwards compatible mode, which means that sites that ran under quirks mode had fewer compatibility problems with older versions of IE.
To trigger quirks mode in IE6 all a designer had to do was to include the xml declaration, eg:
<?xml version="1.0" encoding="utf-8"?>
In IE7, Microsoft removed the ability for the xml declaration to trigger quirks mode. However, because IE7 is still not Standards-compliant (it is marginally better than IE6 in its handling of Standards and CSS) many sites still need to trigger this backward compatibility mode.
The only way to force IE7 to render a site in quirks mode, without affecting the way other browsers render a site, is by including a comment between the xml declaration and the doctype.
This is done like this:
<?xml version="1.0" encoding="utf-8"?>
<!– any comment you like will keep IE7 in quirks mode –>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
Now, keep in mind the simple rule:
- If your template uses the xml declaration, the comment must come AFTER the xml declaration and before the doctype.
- If your template is HTML or XHTML sent as text/html and does NOT use the xml declaration, that is - it starts with the doctype being the first line in the template's index.php, then you place a comment above this. So, the comment will then be the first line in your template's index.php, followed by the doctype.
Both ways will tell IE7 to render the site in quirks mode and will reduce the problems caused by incompatibilities.
You can write anything you like in the comment as long as it is a valid comment and is placed into the correct position in your template's index.php file. Just make the comment meaningful so you will remember why you put it there.







