Moving a site over from transitional to strict doctype.
And Firefox is not displaying the CSS.
I have spent hours trying to solve it, without any luck.
I usually do build for FF first and IE last, but it was always transitional, because I was more forgiving when doing complex design.
I have googled just about everything I can think of related to it.
And I am stuck.
It has got to a minor detail I have overlooked... I probably have just been staring at it for too long.

Can anyone pls help me out?

Dani AI

Generated

Great catch by and the pointer from — this thread shows the classic case where the stylesheet itself and the server headers, not the CSS or the doctype, are the real culprit. The practical checklist below fills in diagnostic steps and small fixes that avoid the “works in one browser but not another” trap.

First, confirm what the browser actually receives. From a shell run:

curl -I http://yourserver/path/style.css

Expect a 200 and a Content-Type header that names a stylesheet (e.g. text/css). Also use the browser’s Network/Inspector panel to see the response headers and HTTP status; a 404, 403 or wrong MIME will stop the stylesheet from being applied.

If the header is wrong, fix the server mapping for .css. On Apache add a mapping (server config or .htaccess); on nginx ensure mime.types is loaded or that text/css is mapped to .css. Note that some hosts disable .htaccess overrides, or serve a default vhost for IP-based access (which can explain why the domain URL worked while the raw IP didn’t). After any change, clear caches or touch the files so proxies and browsers pick up new headers. (httpd.apache.org)

Extra checks that often save time: confirm the link tag points to the right file and returns a 200, verify Content-Encoding (gzip) matches the header, and test via both domain name and IP (name-based virtual hosts can differ). Remember browsers vary: some apply styles despite header issues, others follow the spec and ignore mis-typed resources — which is why differences between IE and Firefox show up.

This thread’s resolution (fixing MIME headers and updating the dev server) was the right move. The above steps make it straightforward to reproduce the diagnosis and apply a permanent fix on Apache/nginx or when asking a host for support.

Recommended Answers

All 5 Replies

Hi rariti,

Yes I think I can help you.. :) that reason is your CSS file is served with text/plain Content-type header not with text/css, which is needed. It's a problem of your web server configuration.

Thanks for replying smalldog. I am not sure what you mean by server configuration. The page looks great in transitional mode. I am just getting into strict doctypes, and so far have hit a very thick brick wall. I have been trying to figure out how to get this page to look right, and why Firefox specifically isn't reading the css.

Rariti, your IP is running Apache web server, right? And I am just telling you, this web server is wrong configured, because returns text/plain Content-type header for CSS file instead of text/css.

Move your page from to and don't worry about that.

Hey thanks for the kick in the behind. MimeTypes.... I would have never figured it was that. It certainly opened my eyes to it. Looks like I got some more reading to do on its importance. I did exactly what SmallDog suggested, and it worked. I was seriously going nuts trying to figure it out. It never crossed my mind that maybe it was the server.

And thanks for the link DanceInstructor. That really helped clear things up. I have put in a ticket to my provider to update the mime-types on this dev server to match my other server. I added the css htaccess line from the Mozilla link. That got the page to display the css right.

I don't know if it was the way I was googling, but when i was trying to figure this out initially, my searches for "Firefox not displaying css with strict doctype" returned nothing about mime-types, or the possibility of it being the server.

Thanks again guys.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.