网上有比较多的帖子,比较全面的有:
https://www.cnblogs.com/Lily-nercel/p/6693293.html
亲测有效。
总结一下要点:
0.添加meta信息:
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
<meta name="viewport" content="width=device-width, initial-scale=1">
1.添加代码:
<!--[if lt IE 9]>
<script src="/myapp/static/js/html5shiv.min.js"></script>
<script src="/myapp/static/js/respond.js"></script>
<![endif]-->
注:其中 html5shiv.min.js 文件是让不(完全)支持html5的浏览器支持 html5 标签;respond.js 文件是让IE8实现对媒体查询(media query)的支持。
2.如果添加以上内容,还不生效,需要检查jQuery是否版本过高,需要降低到2.0以下。