简体   繁体   English

即使IE = edge,兼容模式按钮仍然存在

[英]Compatibility Mode button still there even with IE=edge

According to HTML5 Boilerplate, I would expect the following included meta tag to remove the Compatibility Mode button from IE8: 根据HTML5 Boilerplate,我希望以下包含meta标记从IE8中删除兼容模式按钮:

<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">

But when I view my site in IE8, the compatibility mode button is still there. 但是当我在IE8中查看我的网站时,兼容模式按钮仍然存在。 I want my site to work in IE8 and above and I do not want my visitor's IE browsers to show a compatibility mode button. 我希望我的网站在IE8及更高版本中工作,我不希望我的访问者的IE浏览器显示兼容模式按钮。 The problem is that if someone clicks it by accident and turns on Compatibility mode in an IE8 browser, then my page doesn't render correctly because of weird IE7 quirks. 问题是,如果有人偶然点击它并在IE8浏览器中打开兼容模式,那么由于奇怪的IE7怪癖,我的页面无法正确呈现。

So how do I turn off the button? 那么我该如何关闭按钮呢?

EDIT: 编辑:

Here is the beginning of my head tag: 这是我的head标记的开头:

<head>
    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <title></title>

It's the same as default H5BP. 它与默认的H5BP相同。 I have also tried moving the compat. 我也试过移动compat。 mode meta tag to be the first tag in <head> with no difference. 模式元标记是<head>的第一个标记,没有区别。

This has been going on for a long time ( https://github.com/h5bp/html5-boilerplate/issues/1187 ). 这已经持续了很长时间( https://github.com/h5bp/html5-boilerplate/issues/1187 )。 I use this (modify the classes below the doctype for your needs): 我使用它(根据您的需要修改doctype下面的类):

http://nicolasgallagher.com/better-conditional-classnames-for-hack-free-css/ http://nicolasgallagher.com/better-conditional-classnames-for-hack-free-css/

<!--[if IE ]><![endif]-->
<!doctype html>
<!--[if IE 8 ]> <html class="no-js lt-ie9 ie8" lang="en"> <![endif]-->
<!--[if IE 9 ]> <html class="no-js lt-ie10 ie9" lang="en"> <![endif]-->
<!--[if (gte IE 10)|!(IE)]><!--> <html class="no-js" lang="en"> <!--<![endif]-->
<head>

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM