开发者

Future proof CSS selector for LTE Opera 10 [duplicate]

开发者 https://www.devze.com 2022-12-20 01:13 出处:网络
This question already has answers here: How to make CSS visible only for Opera (13 answers) Closed 3 months ago.
This question already has answers here: How to make CSS visible only for Opera (13 answers) Closed 3 months ago.

The community reviewed whether to reopen this question 2 months ago and left it closed:

Original close reason(s) were not resolved

I am c开发者_运维百科urrently using @media screen and (-webkit-min-device-pixel-ratio:0) to target Webkit browsers + Opera 9.2.

Is there a safe* way to target Opera GTE 9.5 or LTE 10?

* won't be picked up by another browser


That was hard but here it is. Works only in Opera gte 9.5 and lt 10.50:

@media all and (resolution = 0dpi) { // exclude Opera 10.50 and higher
  :root #box { // you need to append :root to all selectors to exclude Opera lt 9.5
    background: #f00;
  }
}


* targets Opera 9 & below (and perhaps future versions) - valid HTML & invalid XHTML */

#dis[disabled="true"]+p {}

Source: http://perishablepress.com/press/2006/08/27/css-hack-dumpster/

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号