How to Target CSS Only for Opera

My case was about font-size and letter-spacing on Opera (11.10). Opera was displaying selected font way too big to fit in allowed space and I needed a hack to fix this issue.
Opera 9 and below
This is pretty straight forward and well known hack:
html:first-child p
{
font-size:12px;
}
The real issue, in my case, was how to target newer and modern Opera versions 10 and 11.
Opera 10 and above
The answer is in media queries. Earlier this was obvious hack while no other browsers supported media-queries properly. However, nowadays more and more browsers support it and therefore we need to tweak the conditions a little:
@media not all and (-webkit-min-device-pixel-ratio:0) {
p {
font-size:12px;
}
}
I’ve validated this with Opera 10.5 and Opera 11. I also checked on Chrome 11, Chrome 12, Firefox 3.6, Firefox 4.0, Safari 5 and IE 8 that it doesn’t affect on them.
Edit: I haven’t tested this on Opera 9 or earlier, but according to other resources, this hack should work on those browsers too.
Conclusion
It’s still possible to write browser-specific hacks but it’s getting more and more complex all the time. In this case we’re using a hack that is actually targeted to WebKit browsers to get them excluded from the media query hack. However, there is no confidence that this hack would work on Opera 12 or next versions of Safari or Chrome would behave as expected.
And big thanks goes to an article CSS Hack or New CSS File for Problematic Browsers? and Is There Any Dedicated CSS Hacks For Safari or Opera?.