Jump to content

CSS file not read by Mozilla browser


theYinYeti
 Share

Recommended Posts

This concerns Mozilla 1.0 on Linux, as well as Mozilla 1.0 and 1.1 on Win2K.

 

I created my personnal web site. I tested it at home with Apache of course. It works well.

 

I tried to do it very much W3C-compliant, so I used a lot of CSS (while still making sure it works without CSS). My problem is that my site, once FTPed to my provider, stops loading CSS!

 

So I looked at Mozilla's "Javascript console", and here are messages I get:

Error: The stylesheet http://.../main.css was not loaded because its MIME type, "text/plain", is not "text/css".

Error: The stylesheet http://.../mainmenu.css was not loaded because its MIME type, "text/plain", is not "text/css".

The strange part is that I made another site at work, for which I get this:

Warning: The stylesheet http://.../index.css was loaded as CSS even though its MIME type, "text/plain", is not "text/css".

So obviously, both sites are not treated equal.

I tried to find differences, and here's all I found:

On my personnal site, page begins with

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN">

<html>

and the CSS link is defined

<link href="../_css/main.css" rel="stylesheet" type="text/css" />

in XHTML notation, whereas on my test site at work, page begins directly with <html> and the CSS link is defined

<link rel="stylesheet" type="text/css" href="index.css">

in HTML notation.

 

Question: does anyone know how to force mozilla to always accept "text/plain" files as CSS files?

 

I tried convincing my provider to reconfigure their web server to give a correct MIME type to CSS files, but to no avail (because there's no problem with Netscape 7, they say).

 

Yves.

Link to comment
Share on other sites

Thanks, I'll try.

 

I have to try myself, because my provider's support are all newbies :evil: :lol: When I talked to them about MIME types errors in the logs, they asked me what is a MIME, what is the URL of the logs I'm talking about, can I explain better please, and what is the URL of the page that gives the error.

 

Yves.

Link to comment
Share on other sites

Sad... the .htaccess file had no effect even on my own Apache (it is enabled in the config file...).

 

Anyway, no problem anymore. With XHTML, CSS files are required to be text/css (that's perfectly normal), and with HTML, CSS are allowed to be anything (more permissive).

 

I looked at my Apache config, and indeed, CSS files are of MIME type text/css, as they should be. I changed this config to text/plain, and I perfectly reproduced my problem (I set it back to normal after).

 

As my provider seems to be totally deaf and blind to W3C standards, I finally removed the DOCTYPE thing from all my XHTML files, and now things work well.

 

Yves.

 

BTW: :idea: what do you think of my site? Not so much the content (can you even read French?), but rather layout and colors. PM me :)

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
 Share

×
×
  • Create New...