简体   繁体   English

Magento Respond.js似乎在ie8及以下版本中混合了样式

[英]Magento Respond.js appears to be mixing up styles in ie8 and below

I'm a little stumped by an issue where Repond.js seems to be mixing up magento Stylesheets in IE. 我对Repond.js似乎在IE中混淆了magento样式表的问题感到有些困惑。

The issue: due to the way Magento imports its CSS respond.js confuses the order of stylesheets. 问题:由于Magento导入CSS CSS的方式。js混淆了样式表的顺序。 When I use developer tools to troubleshoot the issue it is calling syles.css then custom.css then it appears to be calling styles.css again but acting as if they're inline and therefore overriding my custom.css styles. 当我使用开发人员工具解决问题时,它先调用syles.css,再调用custom.css,然后似乎再次调用styles.css,但它们好像是内联的,因此覆盖了我的custom.css样式。 (I'm determining this because a search of the code shows that the specific styles are only being called in stlyes.css) (我正在确定这一点,因为对代码的搜索显示仅在stlyes.css中调用了特定样式)

I can't link to the problem however I could really use some help if someone has been down this road before. 我无法链接到该问题,但是如果有人以前走过这条路,我真的可以使用一些帮助。 Thanks in advance! 提前致谢!

UPDATE: If I comment out line 45 in respond.src.js (the line that returns if media queries are supported) it breaks in every browser. 更新:如果我注释出response.src.js中的第45行(如果支持媒体查询,则返回该行)在每个浏览器中都会中断。 This excludes this as an IE specific problem. 这将其排除为IE特定问题。 Maybe this is caused by the way Magento calls its style sheets (XML File)? 也许这是由于Magento调用其样式表(XML文件)的方式引起的?

UPDATE 2: By removing Custom.css and Respond.js from the magento XML call. 更新2:通过从magento XML调用中删除Custom.css和Respond.js。 My site is no longer breaking In IE. 我的网站不再在IE中崩溃。 However I can't get media queries to work in IE8 and below. 但是我无法使媒体查询在IE8及以下版本中工作。 working on troubleshooting this issue now. 现在正在解决此问题。 Just a note: I'm not using @font-face calls in my css which is known to break respond.js in IE. 请注意:我没有在CSS中使用@ font-face调用,而众所周知,该调用会破坏IE中的response.js。

I've had a similar issue. 我有一个类似的问题。 I ended up specifying !important to the css properties so they overwrite any other styles no matter the order of the call stack. 我最终为css属性指定!important ,因此无论调用堆栈的顺序如何,它们都会覆盖其他任何样式。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM