Local Web page style changes after uploading a server workaround

Source: Internet
Author: User

This time to the company made a website, in the local use IE10, Firefox, goolgechrome,360 browser through the page style test.

The local passed the test and then uploaded to the server, after uploading with IE10 browsing to find a partial style exception. Firefox, goolgechrome,360 browsing is the same as the local browse style effect.

As usual, there are problems to find Niang. Most netizens said: "Coding problem, there is also said that the style is not loaded more to say is the cache problem." I use a text editor notepad++ view CSS files found in ANSI format, is it really coding format problem? Immediately change to UTF-8 save and upload to the server.

The test results have not changed and appear to be not a coding problem. Local testing on the normal remote server is abnormal, is not a problem of the server environment? Build your own IIS immediately, the local server environment is OK, and then test the results are normal. Started to suspect the space quotient server environment, because I use the Windows platform, the space quotient of the Linux platform. No, I'm going to build a Linux platform to test again?

Static heart to think about, other browsers are no problem on IE has a problem, is it supposed to look for problems on IE? Open IE again browse the Remote Server Web page, press the F12 key to hit the developer tool, suddenly I found the browser mode: IE10, document mode: IE7.

There is obviously a problem here, change the document mode to standard. The IE10 page changes immediately, exactly as the previous local test. The cause of the problem has been found. The local style is inconsistent with the remote server because the IE10 document encoding has changed. Find the cause of the problem and enter the solution.

Workaround add <meta http-equiv= "x-ua-compatible" content= "Ie=edge" to the Web page > code. X-ua-compatible is a special file header tag for versions above IE8 to specify different page shading for versions IE8 and above

is not recognized by the version browser under IE8.

The methods available in X-ua-compatible are:

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

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

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

<meta http-equiv= "x-ua-compatible" content= "Ie=edge" >

The last line is edge mode, which notifies Windows Internet Explorer to display content in the highest-level available mode.

Although the problem has been solved, two other problems are eventually exposed.

1, why I built the IIS server, IE Browse document mode is the normal standard. And uploading has become a IE7?

2, the description of CSS file compatibility is not perfect in IE7 or below an exception occurs.


This article is from the "Anthony Big Group" blog, please be sure to keep this source http://52czy.blog.51cto.com/3704825/1548628

Local Web page style changes after uploading a server workaround

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.