@media, -webkit-min-device-pixel-ratio: - css 规则语法不正确
有谁知道这个规则有什么问题吗?
@media 屏幕和 (-webkit-min-device-pixel-ratio:0) { #nav-main li.c_course div{margin-left:1px !important;}
#nav-main li.c_course div{margin-left:1px !important;| margin-right:0px !important;;}
#nav-main li.c_course div div{margin-left:0px !important;}
@media screen and (-webkit-min-device-pixel-ratio:0) {
#nav-main li.c_course div{margin-left:1px !important;}
}
我在 媒体语法可能的组合。这似乎是有效的代码(从帖子来看,即使 7.3 可识别的媒体类型规范没有像OP那样列出语法)。
它应该放置在 .css 中的其他位置还是什么?
谢谢
Does anyone know what is wrong with this rule?
@media screen and (-webkit-min-device-pixel-ratio:0) {
#nav-main li.c_course div{margin-left:1px !important;}
#nav-main li.c_course div{margin-left:1px !important;| margin-right:0px !important;;}
#nav-main li.c_course div div{margin-left:0px !important;}
@media screen and (-webkit-min-device-pixel-ratio:0) {
#nav-main li.c_course div{margin-left:1px !important;}
}
I researched it at media syntax possible combinations. It seems to be valid code (judging by the post even though the 7.3 Recognized media types spec doesn't list the syntax the way the OP does).
Is it supposed to be positioned somewhere else in the .css or what?
Thanks
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
使用代码:
是一种仅针对 webkit 浏览器的方法,因为它与最小像素比为零的 webkit 浏览器匹配,影响的是每个 webkit 浏览器。问题是 webkit 前缀不会根据 W3C 标准进行验证,因为它是特定于供应商的 - 如果您不介意 CSS 验证失败,则应将其用作最后的手段。
Using the code:
Is a way to target just webkit browsers as it matches a webkit browser with a minimum pixel ratio of zero which in affect is every webkit browser. The issue is that the webkit prefix won't validate against W3C standards as it's vendor specific - it should be used as a last resort and if you don't mind the CSS failing validation.
以下是一些信息 www.w3.org/TR/css3-mediaqueries/#设备纵横比。
看来规则应该写成
@media 屏幕和 (min-device-aspect-ratio:0){ ... }
问题是,我不知道“0”是否是有效值。规范使用了一个比率,我不知道编码器使用“0”是什么意思。 “0”无论如何都没有任何意义——所以这个声明似乎毫无意义。
www.w3.org /TR/css3-mediaqueries
Here's some info www.w3.org/TR/css3-mediaqueries/#device-aspect-ratio.
It appears the rule should be written as
@media screen and (min-device-aspect-ratio:0){ ... }
Thing is, I don't know if "0" is a valid value. The spec uses a ratio and I don't know what the coder meant by using "0". "0" means nothing anyway---so the statement seems meaningless.
www.w3.org/TR/css3-mediaqueries