SOLVED: XHTML and Firefox problem

Status
This thread has been Locked and is not open to further replies. Please start a New Thread if you're having a similar issue. View our Welcome Guide to learn how to use this site.

Mikrondel

Thread Starter
Joined
Jun 21, 2005
Messages
43
Seeing as googling and forum searching brought precious little help, I thought I'd post this to help people with a similar problem in the future.

Problem: Styles not being applied in Firefox under XHTML 1.0 transitional, but worked with HTML 4.1. An external CSS file that seemed to be ignored. Javascript problems as well. Other browsers fine.

Cause: Dynamically generated CSS and JS files. Server was reporting MIME type of text/html. HTML page was reporting MIME type of text/css for CSS files. Firefox had been told it was XHTML so was being anal-retentive.

Fix (for PHP): header('Content-type: text/css'); (or Javascript as appropriate). Remember that header() must be called before ANY html output is sent.
 

tomdkat

Retired Trusted Advisor
Joined
May 6, 2006
Messages
7,148
Based on the fix, the problem you encountered related to PHP generated HTML pages, in the first place? Wouldn't it be considered "good practice" to have PHP send the proper content types along with the HTML content it's generating?

Peace...
 
Status
This thread has been Locked and is not open to further replies. Please start a New Thread if you're having a similar issue. View our Welcome Guide to learn how to use this site.

Users Who Are Viewing This Thread (Users: 0, Guests: 1)

As Seen On
As Seen On...

Welcome to Tech Support Guy!

Are you looking for the solution to your computer problem? Join our site today to ask your question. This site is completely free -- paid for by advertisers and donations.

If you're not already familiar with forums, watch our Welcome Guide to get started.

Join over 807,865 other people just like you!

Latest posts

Staff online

Members online

Top