[Web development] Quickly fixes the display compatibility issue of web pages under IE8

Source: Internet
Author: User

By default, IE8 uses the brand new standard Mode Display Engine to display webpages. If the webpage code is not standardized, it may be abnormal in IE8. It takes a long time to rewrite the webpage code to standardize it. A simple and quick way is to let IE8 continue to display your website with the IE 7 Display Engine. We call this old Display Engine compatible view ).

 

Add this line of code to the webpage to enable IE8 to use a compatible View:

<Meta http-equiv = "X-UA-compatible" content = "Ie = emulateie7"/>

 

Sample Code:

<HTML> <br/> <pead> <br/> <! -- Use IE7 mode --> <br/> <meta http-equiv = "X-UA-compatible" content = "Ie = emulateie7"/> <br/> <title> my web page </title> <br/> </pead> <br/> <body> <br/> <p> content goes here. </P> <br/> </body> <br/> </ptml>

 

 

If you useIIS server, Can be configuredWeb. config file:

 

<? 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>

 

You can also use the configuration tool to modify the following:

 

 

IfApache server, Can be configuredHttpd. conf file:

 

Loadmodule headers_module modules/mod_headers.so

Header set X-UA-compatible "Ie = emulateie7"

 

The preceding section allows all webpages to use a compatible view. If you only want to make files in a directory compatible with the view, set the following in <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.