使用PHP作为CSS文件? [英] Using PHP as a CSS file?

查看:117
本文介绍了使用PHP作为CSS文件?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我如何使用PHP作为CSS文件。我刚刚将它作为一个正常的css文件,但它无法在谷歌浏览器中工作。

How would I go about using PHP as a CSS file. I have just included it as a normal css file, but it fails to work in Google Chrome.

推荐答案

您必须告诉浏览器它是一个CSS文件而不是HTML文件,输出:

You have to tell the browser that it is a CSS-file and not a HTML-file, write the following before any output:

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

请参阅:
http://www.barelyfitz.com/projects/csscolor/

这篇关于使用PHP作为CSS文件?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆