Forum Moderators: not2easy

Message Too Old, No Replies

Multiple Style Sheets in Opera?

Multiple CSS not working in Opera correctly

         

The_Warden

5:01 pm on May 31, 2004 (gmt 0)

10+ Year Member



Hi. I'm developing a page that has two style sheets that the client can select. For some odd reason when I load the page up into Opera, Opera always loads the alternate style sheet instead of the default one. The code seems to work fine in IE and Mozilla. What would I be doing wrong that would cause this in Opera? Here's the code I used to load in my style sheets, nested in the <head> tag element.

<link rel="stylesheet" type="text/css" media="screen" href="default.css" title="default" />
<link rel="alternate stylesheet" type="text/css" media="screen" href="default2.css" title="funky" />

This shouldn't have anything to do with it since this is not used until the user clicks on a different style but just in case. I'm using the style switcher provided by A List Apart article "Alternative Style: Working With Alternate Style Sheets" by Paul Sowden.

Oh also just to let you know my page is w3c compliant in CSS and XHTML Strict.

TheDoctor

5:14 pm on May 31, 2004 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



I can't see anything wrong with what you've quoted. the exact same formulation works with Opera on a random page I viewed on my site - only difference is that my alternate style sheet is for printing, and I can't se that making any difference.

I would suggest that the problem is not where you're looking. Try searching for the reason elsewhere. The immediate thing that springs to mind is the JavaScript technique described in the AListApart article for implementing alternate style sheets in IE. Did you try that? If so, have you left a cookie in your cache to tell Opera to use the alternate sheet?

The_Warden

5:31 pm on May 31, 2004 (gmt 0)

10+ Year Member



Oh man, yes you are right. Geez, the cache/cookies were messed up. Sorry for the waste of a post :-).

TheDoctor

9:10 pm on May 31, 2004 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Not a waste of a post:
  1. It solved your problem.
  2. It may help someone else in the future.

In any case, we've all been there. When you spend hours looking at something and can't see anything wrong, it's probably that there is nothing wrong at the place you've been looking. You need someone else to come along and look at the thing afresh.

I'm glad to have been of assistance. I dare say you'll be able to help me some time.