Forum Moderators: not2easy

Message Too Old, No Replies

Firefox uses wrong stylesheet

Two pages, two stylesheets, two directories - Firefox gets mixed up

         

MatthewHSE

3:37 pm on Nov 17, 2006 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



<edit> It appears this problem was simply a Firefox bug. Just after posting, I noticed this happening on other sites as well, but in very different situations. I then realized that my Firefox had been up and running for about two weeks, and it might be entitled to a little rest. So I restarted the browser, and presto, the problem vanished. However, I'll leave the initial question below, just in case someone else encounters this in the future... </edit>

This will be easiest to explain if I start with a little diagram:

In the root directory... 
-- index.html
-- styles.css
-- dir2 (sub-directory)
---- index.html
---- dir2-styles.css

Each HTML file uses the CSS file from the same directory it's in. Notice the stylesheets both have different names and are located in different directories.

If I go to /index.html, it loads the correct stylesheet. I then go to /dir2/index.html and it also loads its correct stylesheet. The problem is that if I click the Firefox "Back" button, /index.html loads initially with the correct stylesheet, then quickly switches to using the stylesheet from /dir2.

It reminds me of FOUC in reverse. The only difference is that, while FOUC uses *no* stylesheet at first, then loads it, this problem starts with the correct stylesheet, then applies the wrong one.

I've tried using the <link> tag with relative and absolute URL's, the @import method, etc. I can't get this problem to go away. There's nothing dynamic about these pages - straight HTML. What gives? I've never seen Firefox do anything like this before!

Thanks for any ideas,

Matthew

[edited by: MatthewHSE at 3:51 pm (utc) on Nov. 17, 2006]

MatthewHSE

5:20 pm on Nov 17, 2006 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Update: Actually, it turned out even different than I expected. I had been using the "Edit CSS" feature of the Web Developer Toolbar. Somewhere along the line I closed the Edit CSS sidebar, but because I'm also using the All-In-One Sidebar extension, which has an option to only hide the sidebar instead of closing it, the Edit CSS sidebar continued to grab the CSS from different pages and tabs as I navigated the Internet, and applied it to whatever page I was currently viewing. Switching to a different sidebar panel finally solved the problem.

jdMorgan

5:23 pm on Nov 17, 2006 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Man, what an ordeal! Glad you got it sorted.

Jim

Ingolemo

6:03 pm on Nov 17, 2006 (gmt 0)

10+ Year Member



The best problems are the ones that fix themselves. :)