May
26
2005

mime types

This has come up a couple times recently on a listserv I’m on, and I’ve dealt with this problem before on a site I helped put together, so I’m storing the answer here for perpetuity…

The problem: Your site looks fine in Internet Explorer, but Netscape and Firefox completely ignore your stylesheet. You have a proper doctype declaration at the top of your HTML page, you’ve validated your HTML and CSS, and you’re pulling your hair out trying to figure out what you’re doing wrong.

The solution: Quite possibly, it’s not you. It’s the server. If you have a proper doctype on your page, Firefox will render the page in “standards mode.” And if your server is sending the CSS file with the wrong MIME type (anything other than “text/css”), Firefox may just completely ignore it. (This is an issue on some Apache and iPlanet installations.) Mozilla’s developer documentation has a detailed explanation of the issue and how to fix it on the server.

Post a comment

As a spam-control measure, your comment may require my approval before it will appear on the entry. Thanks for waiting. To avoid the moderation delay, consider filling in your e-mail address. It won't appear on the site, but I use it to whitelist frequent commenters so their comments appear automatically.


The following HTML tags are permitted (if you want to use them):
p, br, a href, b, strong, u, i, em, ol, ul, li, cite, blockquote