当我使用IE hacks时,兼容模式仍然处于可用状态。但是如果我删除了这些hack,它就会像预期的那样工作。
Hacks (不起作用)
<!doctype html>
<!--[if lt IE 7]> <html class="no-js ie ie6 lt-ie9 lt-ie8 lt-ie7" lang="en"> <![endif]-->
<!--[if IE 7]> <html class="no-js ie ie7 lt-ie9 lt-ie8" lang="en"> <![endif]-->
<!--[if IE 8]> <html class="no-js ie ie8 lt-ie9" lang="en"> <![endif]-->
<!--[if gt IE 8]><!--> <html class="no-js" lang="en"> <!--<![endif]-->
<head>
<meta http-equiv="X-UA-Compatible" content="IE=9; IE=8; IE=7; IE=EDGE" />无黑客攻击(工作正常)
<!doctype html>
<html class="no-js ie ie8 lt-ie9" lang="en">
<head>
<meta http-equiv="X-UA-Compatible" content="IE=9; IE=8; IE=7; IE=EDGE" />我终生都不明白为什么在使用黑客的情况下,compat模式不能正常工作。我正在使用IE8。
发布于 2013-02-09 06:20:42
您需要将IE8切换到quirks模式,对吗?content属性表示要使用哪种兼容模式。它不表示使用quirks模式的IE版本。
试试这个meta标签:
<meta http-equiv="X-UA-Compatible" content="IE=5">https://stackoverflow.com/questions/14757359
复制相似问题