Fix Web page display compatibility issues under IE8

Source: Internet
Author: User

IE8 Displays the Web page by default using the new Standard mode (Standard mode) display engine. If the Web page code is not yet standardized, it may appear to be abnormal under IE8. Rewriting Web page code makes it a lot of work to standardize, and it takes a long time to fix it. A quick and easy way is to let IE8 continue to IE7 the display engine to display your site, which we call the old Display engine compatible (compatibility view).

adding this line of code to the Web page allows IE8 to use a compatible view: <meta http-equiv= "x-ua-compatible" content= "Ie=emulateie7"/> Code example: view Plaincopy to Clipboardprint?


<html>


<head>


<!--use IE7 mode-->


<meta http-equiv= "x-ua-compatible" content= ie=emulateie7 "/>"


<title>my Web page</title>


</head>


<body>


<p>content goes here.</p>


</body>


</html>


<html>


<head>


<!--use IE7 mode-->


<meta http-equiv= "x-ua-compatible" content= ie=emulateie7 "/>"


<title>my Web page</title>


</head>


<body>


<p>content goes here.</p>


</body>


</html> If you use an IIS server, you can configure Web.config files: <?xml version= "1.0" encoding= "Utf-8"?>


<configuration>


<system.webServer>


<httpProtocol>


<customHeaders>


<clear/>


<add name= "x-ua-compatible" value= "Ie=emulateie7"/>


</customHeaders>


</httpProtocol>


</system.webServer>


</configuration> or through the Configuration tool: If you are using the Apache server, you can configure httpd.conf files: LoadModule headers_mo Dule modules/mod_headers.so Header Set x-ua-compatible "Ie=emulateie7" is to make all Web pages use a compatible view. If you want only the files in an individual directory to be in a compatible view, set at <location>: <Location/myfolder>


Header Set x-ua-compatible "Ie=emulateie7"


</Location>

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.