IE8 Browser Mode & Standards Mode

2019-01-23 04:31发布

I need to force IE8 to display as follows:

  1. Browser Mode: Internet Explorer 8

  2. Document Mode: IE8 Standards

I have added this tag however it only affects the document mode, not the browser mode. How do I override browser mode to ensure the page is always shown with IE8 browser mode too?

<meta http-equiv="X-UA-Compatible" content="IE=8" />

6条回答
闹够了就滚
2楼-- · 2019-01-23 05:07

As I understand it, the meta element you've posted tells the browser to use IE8 mode.

Using a strict doctype, e.g. <!DOCTYPE html> or <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd"> will tell the browser to render in standards mode.

A combination of the two will render the page in IE8 Standards mode.

查看更多
男人必须洒脱
3楼-- · 2019-01-23 05:13

Just give the HTML page the right doctype. E.g.

<!doctype html>

For an explanation and overview of all doctypes see http://hsivonen.iki.fi/doctype/. You don't necessarily need those (nasty) meta headers.

查看更多
乱世女痞
4楼-- · 2019-01-23 05:14

The problem resides in the historic battle between developers and Microsoft, and Microsoft's horrifically bad SharePoint Product line. Here is some history http://www.siolon.com/blog/ie-8-compatibility-mode-and-sharepoint/. (Not My Site) Basically IE renders, by default, all Intranet web pages in compatibility mode thus forcing all intranet sites to be no better then IE7. They probably did this because SharePoint is not web standards compliant and MS wanted their product to appear to work well on the corporate intranet sites where Sharepoint was already entrenched. I have a huge issue with this problem on a SharePoint site I am currently working on. Sharepoint uses the SharePoint:CssLink tag to dynamically load css files depending on browser. So while our site is designed for IE9, the IE7.css style sheet is sent to the page because the browser reports itself as an IE7 browser. The only solution in my estimation is to not use IE or design with IE in mind or to use SharePoint. If MS is forced to use web standards just to gain traffic on their platforms, then we might get them to change.

查看更多
Emotional °昔
5楼-- · 2019-01-23 05:18

If you just need to change how it displays locally, you can use the Developer Tools. Press F12 (or choose Developer Tools from the Tools menu). There will be a menu item for both "Browser Mode", and "Document Mode". The change is dynamic and I believe the it will stay for the life of the session.

查看更多
老娘就宠你
6楼-- · 2019-01-23 05:27

It's impossible because the browser mode is determined before sending the request.

查看更多
啃猪蹄的小仙女
7楼-- · 2019-01-23 05:31

It's impossible because the browser mode is determined before sending the request.

This is right, I read microsoft documentation, see below:

An important detail to remember is that Browser Mode is chosen before IE requests web content. This means that sites cannot choose a Browser Mode. Instead site developers choose a Document Mode for their site, which overrides IE’s defaults and declares how a website is rendered.

But for some reason, my functions doesn't work properly if the browser is under IE-8 compat view. Even I have set the document mode correctly to IE8 Standards.

查看更多
登录 后发表回答