让CSS仅适用于歌剧院11? [英] Make CSS apply only for Opera 11?

查看:133
本文介绍了让CSS仅适用于歌剧院11?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

有没有一种方法,使一些CSS规则只适用于歌剧院(11)?

Is there a way to make some CSS rules apply only for Opera (11)?

推荐答案

我喜欢挑战!结果
我花了一些时间,但我终于找到了:

I love challenges!
It took me some time but I finally found it:

body {background:0} /* default */
@media not screen and (1) {
body {background:red} /* OP 11 */
}
@media not screen and (orientation) {
body {background:green} /* for the earlier versions of Opera that pick the first media query's rule + chrome/safari */
}

浏览器进行测试:

browsers tested:


  • 红:歌剧11

  • 绿色:歌剧10和10.5 + WebKit浏览器

  • 无:歌剧9.26 +火狐3.6 + IE9

它涉及到错误处理并也是的其实不是的否定全球结果(WebKit的浏览器不无有效的价值正确评估方向)。由于定位在preSTO支持2.7第二个媒体查询的 FALSE

It's related to the error-handling and also the fact that NOT negates the global result (WebKit browsers don't evaluate orientation correctly without a valid value). Since orientation is supported in presto 2.7 the second media query is FALSE.

错误定向黑客的听起来像一个好名字给我。

The false orientation hack sounds like a good name to me.

这篇关于让CSS仅适用于歌剧院11?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆