2

How could I use separate stylesheet for Opera?

Like:

<![if !IE 6]>
<link rel=»stylesheet» type=»text/css» href=»ctyle.css» />
<![endif]>

But for Opera? (For all versions of Opera)

Kara
  • 6,115
  • 16
  • 50
  • 57
TRAVA
  • 211
  • 2
  • 12
  • 3
    possible duplicate of [How to do a Chrome/Opera specific stylesheet ?](http://stackoverflow.com/questions/945428/how-to-do-a-chrome-opera-specific-stylesheet) – Gert Grenander Jul 27 '10 at 00:52
  • What exactly do you need it for? There are some webkit specific tags that can be used to achieve very specific goals, for everything else, webkit should render similarly to gecko based browsers. – Razor Storm Jul 27 '10 at 00:53
  • Wouldn't just about any method either rely on JavaScript or only work if the browser sent correct and uniquely identifiable user agent information? – Thomas Owens Jul 27 '10 at 00:54
  • @Razor Storm Doesn't Opera use a layout engine called *Presto*? – alex Jul 31 '10 at 11:04
  • @Alex, oops, I was tired and read Opera as Chrome. (Yeah I know the words aren't even similar, no idea what I was thinking). – Razor Storm Jul 31 '10 at 21:18

1 Answers1

3

I don't think you can without sniffing the user agent with server side code or JavaScript.

Besides the usual caveats of user agent sniffing, server side code would be more reliable as it wouldn't require JavaScript enabled.

There may also possibly be Opera specific hacks, but implementing these would be even worse than sniffing IMO.

If there are layout problems, I would Google the bug and see what solutions exist to fix. You may not even need a separate stylesheet.

alex
  • 479,566
  • 201
  • 878
  • 984