Conditional CSS for Opera
Moderator: General Moderators
Conditional CSS for Opera
I know there is the <!--[if IE 7]> for IE, but what is the once for Opera if there is one?
- Kaleb Klein
------------------------------------
Web Developer | Software Developer
https://kalebklein.com
PGP Key: https://keybase.io/pazuzu156
------------------------------------
Web Developer | Software Developer
https://kalebklein.com
PGP Key: https://keybase.io/pazuzu156
Re: Conditional CSS for Opera
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
- social_experiment
- DevNet Master
- Posts: 2793
- Joined: Sun Feb 15, 2009 11:08 am
- Location: .za
Re: Conditional CSS for Opera
I found this on the site below
how-to-make-a-css-if-opera-not
Code: Select all
if (window.opera) { document.getElementById('foo').style.height = '100px'; }
“Don’t worry if it doesn’t work right. If everything did, you’d be out of a job.” - Mosher’s Law of Software Engineering
- social_experiment
- DevNet Master
- Posts: 2793
- Joined: Sun Feb 15, 2009 11:08 am
- Location: .za
Re: Conditional CSS for Opera
Not quite, even if you have correct CSS not all browsers (not yet anyway) display the style rules exactly the same. Hence conditional options.clint_psoriasis wrote:If you properly built your CSS its run properly in all browser.
“Don’t worry if it doesn’t work right. If everything did, you’d be out of a job.” - Mosher’s Law of Software Engineering
Re: Conditional CSS for Opera
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.
- Kaleb Klein
------------------------------------
Web Developer | Software Developer
https://kalebklein.com
PGP Key: https://keybase.io/pazuzu156
------------------------------------
Web Developer | Software Developer
https://kalebklein.com
PGP Key: https://keybase.io/pazuzu156