带有respond.js和html5shiv.js的Bootstrap 3仍然无法在IE8上运行 [英] Bootstrap 3 with respond.js and html5shiv.js still not working on IE8
问题描述
我有一个运行Bootstrap 3的网站,并且在除IE8之外的所有浏览器上都能正常运行。这是不支持媒体查询的问题,因此内容会像在移动设备上运行一样延伸。
I have a website which is running Bootstrap 3 and working perfectly on all browsers except IE8. It's the problem where the media queries aren't supported, so the content stretches as if it was run on a mobile device.
我尝试过包括来自Google的respond.js,html5shiv.js和html5shim。还包括meta http-equiv-tag。媒体查询似乎仍然不起作用。
I have tried including respond.js, html5shiv.js and the html5shim from Google. Also the meta http-equiv-tag is included. The media queries still don't seem to work.
此外,我知道respond.js因为它的xmlHttpRequest-thingy而无法在本地运行,但此站点正在运行在网络服务器上。
Also, I know respond.js doesn't work locally because of it's xmlHttpRequest-thingy, but this site is running on a webserver.
我也确定找到了respond.js和html5shiv.js并且链接没有被破坏。
I've also made sure both respond.js and html5shiv.js are found and the links are not broken.
任何想法?
推荐答案
好的,所以无响应的css文件并不是我们想要的。但是,我们发现了这个问题:
Okay so the non-responsive css file wasn't exactly what we were looking for. However, we found the problem:
IE8似乎不喜欢@ import-property。
IE8 doesn't seem to like the @import-property.
我们使用了一个导入必要样式的全局css文件。将所有样式表移动到标题并将其包含在普通的链接标记中时,它可以正常工作。
We used a global css file which imported the necessary styles. When moving all stylesheets to the header and including them with a normal link-tag, it works.
虽然常见的引导样式(按钮,背景等)很奇怪进口得当。网格系统不是。我猜Internet Explorer以神秘和迟钝的方式工作。
It's weird though, the regular bootstrap styling (buttons, backgrounds and such) got imported properly. The grid system was not. I guess Internet Explorer works in mysterious and retarded ways.
这篇关于带有respond.js和html5shiv.js的Bootstrap 3仍然无法在IE8上运行的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!