Make CSS apply only for Opera 11?

2019-01-18 05:34发布

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

8条回答
太酷不给撩
2楼-- · 2019-01-18 06:28

The following style would indeed only get rendered in Opera. See Webmonkeys blog post for details:

@media all and (-webkit-min-device-pixel-ratio:10000), not all and (-webkit-min-device-pixel-ratio:0) {
    #myid { background-color: #F00; }
}

But keep in mind, that all sort of CSS hacks might not work anymore in the future. So I would strongly recommend you to add the styles dynamic only for Opera with jQuery (jQuery.browser).

查看更多
地球回转人心会变
3楼-- · 2019-01-18 06:29

check out this SO Community Wiki.

查看更多
登录 后发表回答