IE8支持CSS Media Query [英] IE8 support for CSS Media Query
问题描述
IE8不支持以下CSS媒体查询:
@import url(desktop.css)屏幕和min-width:768px);
如果没有,替代的写法是什么?
$ b >
@import url(desktop.css)screen;
@import url(ipad.css)only screen and(device-width:768px);
IE9之前的Internet Explorer版本媒体查询。
如果您正在寻找一种降低IE8用户设计的方法,您可能会发现IE的条件注释帮助。使用这个,你可以指定一个IE 8/7/6特定的样式表,它写入了以前的规则。
例如:
< link rel =stylesheettype =text / cssmedia =allhref =style.css/>
<! - [if lt IE 9]>
< link rel =stylesheettype =text / cssmedia =allhref =style-ie.css/>
<![endif] - >
这将不允许IE8中的响应式设计,但可以是一个更简单和更方便的解决方案比使用JS插件。
Does IE8 not support the following CSS media query:
@import url("desktop.css") screen and (min-width: 768px);
If not, what is the alternate way of writing? The same works fine in Firefox.
Any issues with the code below?
@import url("desktop.css") screen;
@import url("ipad.css") only screen and (device-width:768px);
Internet Explorer versions before IE9 do not support media queries.
If you are looking for a way of degrading the design for IE8 users, you may find IE's conditional commenting helpful. Using this, you can specify an IE 8/7/6 specific style sheet which over writes the previous rules.
For example:
<link rel="stylesheet" type="text/css" media="all" href="style.css"/>
<!--[if lt IE 9]>
<link rel="stylesheet" type="text/css" media="all" href="style-ie.css"/>
<![endif]-->
This won't allow for a responsive design in IE8, but could be a simpler and more accessible solution than using a JS plugin.
这篇关于IE8支持CSS Media Query的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!