@import in @media not working in Firefox 3.0.3

空扰寡人 提交于 2019-12-04 07:22:28

Firefox is following the CSS2 specification, while IE is playing fast and loose, as it were.

The exact reason is that @import directives must be the first directives after the optional @charset directive. They cannot appear inside of any block. If you want an @import to apply to only one media type, specify that after the imported URI.

Here is the pertinent section of the CSS2 specification: 6.3 The @import rule.

Ok, so Firefox doesn't like the method I chose, favouring:

@import 'stylesheet.css' media_type;

But IE7 doesn't understand this method, but this could be good:

@import 'firefox-screen.css' screen;
@media screen { @import 'IE7-screen.css'; }
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!