Welcome to WebmasterWorld Guest from 22.214.171.124
Forum Moderators: incrediBILL
The html and css for this website validated when uploaded from his local machine. It was strict html 4, so naturally it should be rendered in standards mode. And yet, when browsing to the online pages with Firefox, the page was TOTALLY unstyled -- even though Opera and IE looked perfect.
One clue -- when he removed the DTD and threw things into quirks mode, there was some styling (even though the layout suffered greatly).
The answer was immediate when I asked the W3C to validate the online .css file -- the mime type for a .css file was improperly configured on the server. It was set to text/plain when it should be text/css (thanks to the W3C for catching this.)
IE and Opera will forgive this little error, but FireFox will not. In our case, we knew the server admin was not quite with-it, and was also not available, so we uploaded an htaccess file with one line:
AddType text/css .css
All fixed. But if you don't know about mime types ahead of time, this can prove a difficult problem to research -- so I thought I'd share the information for future reference.
AFTER I found the answer, I also found several threads here that mention the issue, even from this year:
A good example is for colors. In quirks mode, the following (invalid) syntax will work:
In standards-compliance mode, you must use the
I didn't realize that the CSS validator was not checking the declared MIME type, though, I had not seen that before!