Page 1 of 1

Conditional CSS for Opera

Posted: Sun Aug 21, 2011 1:05 pm
by Pazuzu156
I know there is the <!--[if IE 7]> for IE, but what is the once for Opera if there is one?

Re: Conditional CSS for Opera

Posted: Sun Aug 21, 2011 9:27 pm
by Weirdan
There's none as far as I know. You'd better be styling based on browser capabilities rather than based on user agent though, with something like Modernizr

Re: Conditional CSS for Opera

Posted: Mon Aug 22, 2011 3:03 pm
by social_experiment
I found this on the site below

Code: Select all

if (window.opera) { document.getElementById('foo').style.height = '100px'; }
how-to-make-a-css-if-opera-not

Re: Conditional CSS for Opera

Posted: Thu Aug 25, 2011 12:33 pm
by social_experiment
clint_psoriasis wrote:If you properly built your CSS its run properly in all browser.
Not quite, even if you have correct CSS not all browsers (not yet anyway) display the style rules exactly the same. Hence conditional options.

Re: Conditional CSS for Opera

Posted: Thu Aug 25, 2011 1:44 pm
by Pazuzu156
It's just that some CSS won't work with Opera like Firefox and Chrome. But I'll probably just stick with the JavaScript to style it for now. Thanks anyways.