Re: css validation

That's an easy fix. Put this line at the top of your PHP file.

**** begin PHP code ****
header("Content-Type: text/css");
**** end PHP code ****

http://www.php.net/header


Scott Fetherlin (ZiaNet Tech Support) wrote:

>i fixed the issue with ff by adding Transitional to the doctype on my web
>pages.  its wierd how they worked before but now i have to specify
>transitional type.  i fixed (on most of my pages) the type="text/css" line
>or added it, i should say.
>
>i think it is being sent as html because of php.  i have an example of what
>i did with the server and the pages at www.linuxoverwindows.com/forum.php
>under css + php making them work together.
>
>i also finally figured out how to make my own customized error page to serve
>all the domains and all the errors from 1 page.  i will post that one on the
>forum for anyone interested.  but that was off topic.
>
>my main thing with the css was to have a single css sheet for each domain.
>then i could simply change variables via a page that would edit the
>style.php page with the proper variables for the style.css (script, if you
>will).  im not sure yet how to make php, from within the script, not to send
>its output as html.  if thats what i need to do.
>
>but i was curious about the validator.  thank you for your responses.
>scott
>----- Original Message ----- 
>From: "Paul Norman" <penorman@mac.com>
>To: "scott fetherlin" <linux@zianet.com>
>Cc: <www-validator-css@w3.org>
>Sent: Saturday, June 11, 2005 6:37 PM
>Subject: Re: css validation
>
>
>  
>
>>i am curious why my css validates straight from the website uri
>>(www.linuxoverwindows.com) but not the stylesheet itself
>>(www.linuxoverwindows.com/css/style.css)
>>    
>>
>
>The second file (style.css) is not being sent as CSS but is being sent
>as HTML. The mime type being used is text/html. You need to change your
>server configuration to send CSS files with the MIME type of text/css.
>
>One thing that puzzles me is why it validates the CSS when you point it
>at <http://www.linuxoverwindows.com>.
>
>  
>
>>pages seem to load fine in internet explorer but not in a compliant
>>browser like firefox.
>>    
>>
>
>Firefox may be displaying your pages differently then you expect because
>you are not sending your stylesheets as CSS.
>
>
>  
>

Received on Sunday, 12 June 2005 02:17:50 UTC