Opera 10.50 began to support border-radius and many other interesting things. In this regard, the question arose - how to distinguish Opera 10.50 from earlier versions in CSS?
For example, on my website rounded corners for the “Opera”, starting from version 9.50 are made with the help of SVG, 10.50 could easily draw them without this “refinement”. I tormented, tormented and invented several CSS hacks, my own invention.
- @media (0) {
- body { background : red ; } / * Opera 10.xx, but <10.50 * /
- }
- @media all and (resolution = 0dpi) {
- body { background : red ; } / * Opera <10.50, I don’t know the minimum version, 9.27 works * /
- }
- @media all, () {
- body { background : red ; } / * Opera 10.xx (including 10.50) * /
- }
- @media all, {
- body { background : red ; } / * Opera 10.50 prealpha * /
- }
It is necessary to understand that hacks are made solely in order to distinguish one version of “Opera” from another and can work in other browsers, so it’s better to err and add some hack to the styles to distinguish “Opera” from everything else.
I don’t know the minimum version under which hack # 2 works, but I
suspect that it will work somewhere from version 7 onwards.
')
I tested all the hacks on "Operah" 10.50 prealpha, 10.10, 10.01, 9.50 and 9.27. Hopefully, bug 10.50 will not be fixed and the hack will continue to work (
pepelsbey , please be silent! :).