respond.js polyfill 不适用于 IE8 中的最后一个媒体查询

发布于 2024-12-17 19:09:31 字数 364 浏览 3 评论 0原文

我的 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 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(3

花落人断肠 2024-12-24 19:09:32

我在这方面遇到了几个问题,并且发现它时断时续地工作。首先,根据我读过的论坛,您不应该包含来自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! =)

揪着可爱 2024-12-24 19:09:32

使用respond.js时需要记住一些事情

  1. 它需要通过对link元素中的样式表进行ajax调用来解析CSS
  2. 它无法理解从例如客户端LESS动态创建的CSS ,或通过 document.write、jQuery 等注入的样式。
  3. 样式表内不遵循 @Import 语句

希望这有帮助。

There are a few things to bere in mind when using respond.js

  1. It needs to parse the css by making an ajax call to the stylesheet in a link element
  2. It cant understand dynamically created CSS from eg client side LESS , or styles injected via document.write, jQuery etc,.
  3. @Import statements are not followed inside stylesheets

Hope this helps.

冷心人i 2024-12-24 19:09:32

我不确定这是否适用于您,但我刚刚发现一个在使用 respond.js 时破坏 css 的问题。

你有没有任何可以打开和关闭的没有样式的元素,即:

ul.demo{}

我发现这破坏了 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:

ul.demo{}

I found this was breaking my css in ie 8 and below

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文