The HTML5 doctype is not triggering standards mode in IE8

前端 未结 3 1799
青春惊慌失措
青春惊慌失措 2020-12-09 22:20

i work for a company where all our sites currently use the XHTML 1.0 transitional doctype (yes i know it is very old school). I want to change them all to use the HTML5 doct

3条回答
  •  生来不讨喜
    2020-12-09 23:09

    There’s a couple of settings in IE 8 that can cause pages to render in Compatibility Mode, regardless of the page’s HTML content or HTTP headers:

    1. Page > Compatibility View Settings

      • If “Display intranet sites in Compatibility View” is checked, then IE will render all sites on the local network in compatibility view. (This has happened to me a few times during development.)

      • If “Include updated website lists from Microsoft” is checked, then IE will download a list of websites from Microsoft and render them all in compatibility view.

      • If “Display all websites in Compatibility View” is checked, then, well, you can guess what happens.

    2. Tools > Internet Options > Advanced > Browsing

      • If “Automatically recover from page layout errors with Compatibility View” is checked, then IE will sometimes switch to compatibility view if it thinks a page’s layout is broken.

    3. And, finally, if you navigate to a page and then click on Page > Compatibility View (or click on the compatibility view icon in the address bar), then that page will be rendered in compatibility view.

    So, although it’s worth putting X-UA-Compatible in there and using a doctype like the HTML5 one (so that your intentions are clear), always check these settings first when testing.

提交回复
热议问题