Forum Moderators: open

Message Too Old, No Replies

Weird CSS style sheet loading problem

         

benj0323

11:28 pm on Nov 27, 2004 (gmt 0)

10+ Year Member



This is kind of a strange problem and it only does this in Firefox. I have spent almost a week trying to figure this out and I would GREATLY appreciate any help. I would even be willing to compensate your efforts if you can figure out the problem.

Here is the problem: I load my CSS style sheet like this:

<link rel="stylesheet" type="text/css" href="global.php?template=global_css&amp;ext=css&amp;cache=1" />

Notice its just a php file. Well, all of my CSS is in a database and I just echo out the CSS in the database with a PHP file. I set the appropriate headers and it works beautifully. Well when you first access the site in Firefox it doesnt load some of the CSS. It loads only some, because my background image is in the CSS and the background image shows up fine, but the rest of the site looks like complete crap, like the CSS never loaded. The background image wouldnt even show up unless my style sheet was loaded. Then I hit refresh and everything looks perfect. It only happens when you first access the website. The only thing I can think of is that the CSS style sheets, when loaded in firefox, have different headers. I have no idea. It's probably the strangest problem I've ever come across in my 6 years of web development.

I know I'm not allowed to post links on here, but the only way to really understand this problem is to see for yourself.

<snip>

Notice when you first access the site it looks like crap, then you hit refresh and it looks fine. Be sure to access the site in firefox first.

Thanks a ton for your help.

[edited by: Woz at 1:30 am (utc) on Nov. 28, 2004]
[edit reason] Sorry, no self URLs please, see TOS#13 [/edit]

jomoweb

12:50 am on Nov 30, 2004 (gmt 0)

10+ Year Member



Ben,

Hate to be the guy that suggests "Is is plugged in?" But is there an error in your stylesheet like a missed bracket or semi-colon. Firefox is a little more strict with these things.

[edited by: tedster at 12:54 am (utc) on Nov. 30, 2004]

encyclo

12:53 am on Nov 30, 2004 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



If you build a static test version with a call to a normal CSS file, does the same thing happen? If the answer is no, then the problem is with your PHP. If the answer is yes, does your CSS validate?

jomoweb

7:49 am on Nov 30, 2004 (gmt 0)

10+ Year Member



Also, are you using any javascripts or siomilar things on your page? I have a site that has a call to a weather channel script. For some reason if the script doesn't load real fast, then the css doesn't full load either. I get the same problem you described.