[thelist] text/css mime type set on server

Joe Crawford jcrawford at avencom.com
Mon Oct 8 13:07:27 CDT 2001


iris wrote:
> i tried to validate some stylesheets at
> http://jigsaw.w3.org/css-validator/validator-uri.html
> and it gave me this error:
> 
> "I/O Error: Unknown mime type : text/plain"
> first i was wondering if i was doing something wrong
> but after a bit of investigation i found this on one
> of the w3c mailing lists:
> 
> "CSS files are under the mime type text/css, and not
> text/plain. I suggest you change the configuration of
> your server."
> 
> and this at ALA:
> 
> "Your CSS files may be properly marked "text/css"
> (ours were), but your hosting company may be serving
> them as "text/plain" if the systems administrator
> ("server guy") has not set up the proper MIME types."
> 
> so i started hassling the sys admin at the university
> where i work about it and he told me there's something
> wrong with the validator since all browsers are
> displaying it just fine.  i don't think he
> understands...

Yeah, he's making the practical argument that "it works" -but the right
way to serve a CSS file is to /tell/ the browser that it's a CSS file.
You might point him at this:
http://www.rexswain.com/httpview.html

And show him some urls of css files with the correct mimetype ( ex:
http://www.artlung.com/style/2001.css ) -- my hosting company has it set
up correctly, so I get a content type of

Content-Type: text/css

just as most html pages have:
Content-Type: text/html

> so what can i tell him to make him understand?  or is
> he right, it doesn't matter?

What kind of server do they run? (if publicly accessible you can do a
http://www.netcraft.com/whats ) on it to see. Then find him the
instructions for addding mimetypes to the server. Most servers these
days come with mimetypes preinstalled, but it's something an admin
should know how to do.

Alternately, if you are on unix and have .htaccess, you can do AddType
text/css .css (I think that's right) and Apache will respect that and
send the correct header - which will in turn make the w3c validator
happy.

HTH,
	Joe <http://artlung.com/>
-- 
...................  Joe Crawford \\ Web Design & Development
.....  mailto:jcrawford at avencom.com \\ http://www.avencom.com
.... San Diego \\ CA \\ USA \\ AVENCOM: Set Your Sites Higher




More information about the thelist mailing list