Forum Moderators: not2easy

Message Too Old, No Replies

Firefox won't load stylesheet from server

         

rmcweb

1:50 am on May 17, 2005 (gmt 0)

10+ Year Member



I've been developing a small website on my local machine. I'm using CSS (for the first time) and testing it using Firefox.

Everything works fine locally. However, when I copy the site to an Apache server and try to display it in Firefox, no CSS is loaded.

Interestingly, IE loads the CSS just fine. It doesn't look right, but at least it's trying!

Update: Finally had the insight to look at the Javascript console in Firefox and got a (partial) answer, in the form of the following:

Error: The stylesheet [example.com...] was not loaded because its MIME type, "application/x-pointplus", is not "text/css".

This requires a setting change on Apache, correct?

Thanks,
Rick

[edited by: rmcweb at 1:59 am (utc) on May 17, 2005]

[edited by: tedster at 2:32 am (utc) on May 17, 2005]
[edit reason] make url anonymous - example.com [/edit]

encyclo

1:54 am on May 17, 2005 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Welcome to WebmasterWorld [webmasterworld.com] rmcweb.

If you are using standards-compliance mode in Firefox, the stylesheet won't load if the MIME type is not

text/css
. This is usually because of a server misconfiguration. If you load the CSS file directly in the browser then view page info, what MIME type is listed?

rmcweb

2:05 am on May 17, 2005 (gmt 0)

10+ Year Member



Thanks for your quick response, encyclo.

I think your post crossed with my update to the original post. I believe the new information supports your theory.

Unfortunately, I'm new enough to this whole thing that I don't know how to load CSS directly into the browser as you suggest. I'm willing to learn...

Rick

rmcweb

2:29 am on May 17, 2005 (gmt 0)

10+ Year Member



Further update: I'm not quite as dumb as I thought. (No comments, please.) After the last post, I did the obvious thing on my local copy of the site by typing the address of the CSS file into the address bar. It worked just as I'd have expected: It displayed the CSS text. Once displayed,page info indicated a type of text/css. No surprises.

However, when I try the same maneuver against the remote copy, Firefox tries to open the file instead of merely displaying it. How come? Is that a function of the incorrect MIME type on the server?

Rick

jdMorgan

3:26 am on May 17, 2005 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



> Is that a function of the incorrect MIME type on the server?

Yes,

Try adding the line:


AddType text/css .css

to httpd.conf or to an .htaccess file on your server.

Jim