Firefox not loading PHP stylesheet

PostJun 19th, 2008 | Comments (5)
Quick tip:

If you're going to create a dynamic CSS stylesheet using PHP (e.g. style.php instead of style.css), make sure you spit out a "content-type" header at the top of the stylesheet or Firefox will choke and not load it.

Put this at the top of the page:

<?php header("Content-type: text/css"); ?>

Comments

BLRJan 15, 2009
Many thanks for this. Firefox was driving me crazy.
TLKMar 4, 2009
Same here. Thank you!
MikeMay 7, 2009
Thank you, thank you. One thousand times thank you. I am new to PHP, and this was driving me crazy.
PaulFeb 19, 2010
Thanks! That tip saved me hours of time!
Paul@WebTrainingMay 17, 2010
Thanks for this. Yours was the first result I found and it worked a charm! :)

Post a comment

Name
URL
Email
Comment