SammyP Posted July 18, 2007 Share Posted July 18, 2007 I am unable to get my style sheet to work in Firefox. It has nothing non-standard, but it does change depending on some system variables, so it is a php file. In IE, both of the following work: <link rel='stylesheet' type='text/css' href='style.css' /> <link rel='stylesheet' type='text/css' href='style.php' /> But in Firefox the latter one gets ignored. Does anyone know why, or a way around this? I could try to get my server to parse .css files I guess, but it shouldn't be necessary. I am not sure how I could do that anyway. Sam. Quote Link to comment https://forums.phpfreaks.com/topic/60567-solved-dynamic-css-file-ignored-by-firefox/ Share on other sites More sharing options...
dbrimlow Posted July 18, 2007 Share Posted July 18, 2007 Why would you even use a php ext. for a style sheet? A style sheet should not have anything in it but text. But if you have a php file with sniffers for certain variables, then have that called elsewhere but not using the <link rel='stylesheet' type='text/css' href=> link. See what it says when you run it through the html validator at http://validator.w3.org/ Quote Link to comment https://forums.phpfreaks.com/topic/60567-solved-dynamic-css-file-ignored-by-firefox/#findComment-301696 Share on other sites More sharing options...
SammyP Posted July 19, 2007 Author Share Posted July 19, 2007 Thanks for that. All of the style sheet items are held in a database, so the style.php file looks just like a css file, but it is being generated on the fly. I guess there is no reason why it couldn't be inserted into the header rather than being external. Is that what you mean? The validator had no problem with that line. Didn't like a lot of the other ones though! Sam. Quote Link to comment https://forums.phpfreaks.com/topic/60567-solved-dynamic-css-file-ignored-by-firefox/#findComment-302150 Share on other sites More sharing options...
ToonMariner Posted July 19, 2007 Share Posted July 19, 2007 try putting the correct header at the top of the style.php file... <?php header("Content-type: text/css"); ?> Quote Link to comment https://forums.phpfreaks.com/topic/60567-solved-dynamic-css-file-ignored-by-firefox/#findComment-302176 Share on other sites More sharing options...
SammyP Posted July 19, 2007 Author Share Posted July 19, 2007 They say there is never a quick and easy solution, but this just shows that sometimes there is. Thanks for that, worked a treat. Site isn't looking perfect in Firefox, but it is at least looking better, and I can start working out what else Firefox doesn't like. Sam. http://www.wandsworthdemons.com/ Quote Link to comment https://forums.phpfreaks.com/topic/60567-solved-dynamic-css-file-ignored-by-firefox/#findComment-302181 Share on other sites More sharing options...
dbrimlow Posted July 25, 2007 Share Posted July 25, 2007 TM! Great catch. Quote Link to comment https://forums.phpfreaks.com/topic/60567-solved-dynamic-css-file-ignored-by-firefox/#findComment-307392 Share on other sites More sharing options...
ToonMariner Posted July 25, 2007 Share Posted July 25, 2007 TY DB Quote Link to comment https://forums.phpfreaks.com/topic/60567-solved-dynamic-css-file-ignored-by-firefox/#findComment-307476 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.