Fix common IE problems: Update your docmode for web standardsby Rey Bango, Senior Technical Evangelist Document compatibility defines how a browser renders your website. The more specific you are at telling the browser what to expect, the better the experience for your users. When using web standards like HTML5, start by explicitly declaring the HTML5 document type: This markup triggers standards mode in Internet Explorer 9 and 10. And it also works well in Chrome and Firefox. Four steps will get your site ready for many browsers and devices: Step 1: Validate that your site uses standards modeCheck whether or not your site is currently in standards mode: 1. Open the website in IE10 platform preview.
2. Press F12 to launch the IE Developer Tools or find it on the Tools menu as shown below:
3. Check if your site indicates Browser Mode: IE10 and Document Mode: IE10 standards as shown in the toolbar below: 4. If your site is in Browser Mode: IE10 and Document Mode: IE10 Standards, you’re done! Note if the Browser Mode and Document Mode of your site are different than above. A common example is Browser Mode = IE8 and Document Mode = Quirks which indicates that your website was designed for older versions of IE and may not be ready for web standards. Step 2: Implement docmode for web standardsForce IE10 standards mode to test your website: 1. Insert <!DOCTYPE html> into your website’s HTML page
2. Reload your page in the browser and check the Browser Mode and Document Mode again using the F12 Developer Tools. If Browser Mode: IE10 and Document Mode: IE10 standards are not shown, continue below. Step 3: Determine why your site is not in Standards ModeMost problems are related to supporting older versions of IE. Start by ensuring your standards-based code is rendered in IE9 and 10. Then keep your non-standards-based code for older versions of IE. 1. My page is not in Browser Mode: IE10
2. My page is not in Document Mode = IE10
Learn more about how to update your doctypes here.
Remove it and reload your page. Continue testing. Learn more about Specifying Document Compatibility Modes here. Step 4: Resolve common IE problems when updating docmodeMost problems are related to supporting older versions of IE. Start by ensuring your standards-based code is rendered in IE9 and 10. Then keep your non-standards-based code for older versions of IE.
Remove it and reload your page. Continue testing. Learn more about Conditional Comments here.
Start by implementing feature detection where possible with web standards. Learn more about User-Agent Strings here. The IE10 User-Agent String is located here. Other reasons my page does not render correctly:
A list of common problems is available in the IE Compatibility Cookbook (https://msdn.microsoft.com/en-us/library/ff986083(VS.85).aspx. If you’re unable to update your docmode with these resolution steps, tweet us @IE or check the Forums on MSDN. For further detail, try these articles:
About the AuthorRey Bango is a technical evangelist at Microsoft and is an immensely proud member of the jQuery JavaScript library’s Core Project Team as well as a writer for the top Ajax & JavaScript online publication Ajaxian.com. He is listed by ThinkVitamin.com as one of the top web developers to follow on Twitter. |