respond.js polyfill 不适用于 IE8 中的最后一个媒体查询
我的 CSS 中有两个媒体查询(不包括打印查询): @media screen and (min-width: 720px) {}
和 @media screen and (min-width: 1026px) {
我正在使用 respond.js 让它们在 IE8 下表现。奇怪的是,它工作得很好,除了最后一个媒体查询,它恢复到媒体查询之前的 CSS。即,在窗口宽度达到 1026px 阈值之前,它会正常工作。
有人知道那里发生了什么吗?以下是预览链接:http://bit.ly/i6ITPe
非常感谢您的回答
I have two media queries in my css (not counting the print one) :@media screen and (min-width: 720px) {}
and @media screen and (min-width: 1026px) {
I am using respond.js to get them to behave under IE8. The weird thing is that it works perfectly, except for the last media query where it reverts back to the css before the media queries. I.e., it works well until the window hits that 1026px threshold in width.
Anybody got an idea as to what is going on there ? Here is the link to the preview : http://bit.ly/i6ITPe
Thanks a bunch for any answer
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
我在这方面遇到了几个问题,并且发现它时断时续地工作。首先,根据我读过的论坛,您不应该包含来自modernizr的respond.js,他们很可能会放弃它。此外,当您包含 respond.js 时,请将其添加到所有样式表之后。它应该是最后加载的东西之一。希望有帮助! =)
I have been having several issues with this and have found it working on and off again. First off based on the forums I have been reading you should not include respond.js from modernizr, they are more than likely going to drop it. Also when you include respond.js add it after all of your stylesheets. It should be one of the last things to load. Hope that helps! =)
使用respond.js时需要记住一些事情
link
元素中的样式表进行ajax调用来解析CSSdocument.write
、jQuery 等注入的样式。希望这有帮助。
There are a few things to bere in mind when using respond.js
link
elementdocument.write
, jQuery etc,.@Import
statements are not followed inside stylesheetsHope this helps.
我不确定这是否适用于您,但我刚刚发现一个在使用 respond.js 时破坏 css 的问题。
你有没有任何可以打开和关闭的没有样式的元素,即:
我发现这破坏了 ie 8 及以下版本中的 css
I'm not sure if this applies to you, but I just found an issue that breaks the css while using respond.js.
do you have any elements that open and close with no styles i.e:
I found this was breaking my css in ie 8 and below