Future proof CSS hack for LTE Opera 10

醉酒当歌 提交于 2019-12-20 02:15:07

问题


I am currently 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


回答1:


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;
  }
}



回答2:


* 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/



来源:https://stackoverflow.com/questions/2243522/future-proof-css-hack-for-lte-opera-10

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!