簡體   English   中英

如何將w / PHP和自定義css指令回顯到此css文件中?

[英]How can I echo w/ PHP , custom css directives into this css file?

http://www.easysavannah.com/myspace1/template/default/css.css我現在使用此程序對Myspace類型的網站進行Beta版測試>

使服務器將CSS文件解析為PHP,然后將其添加到CSS文件的頂部:

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

我相信使CSS文件通過PHP運行的.htaccess行是:

AddType application/x-httpd-php .css

警告! Opera將嘗試緩存具有CSS內容類型的php文件。 建議除了聲明文本/ css內容類型之外,還應在CSS文件的開頭包含以下完整代碼:

<?php

    header("Content-type: text/css");

    //http://www.thinkvitamin.com/features/webapps/serving-javascript-fast
    //required so Opera does not cache this file
    # 'Expires' in the past
    header("Expires: Mon, 26 Jul 1997 05:00:00 GMT");
    # Always modified
    header("Last-Modified: ".gmdate("D, d M Y H:i:s")." GMT");
    # HTTP/1.1
    header("Cache-Control: no-store, no-cache, must-revalidate");
    header("Cache-Control: post-check=0, pre-check=0", false);
    # HTTP/1.0
    header("Pragma: no-cache");

?>

為了提醒自己,這些是css文件,我維護以下命名約定:

file-name.css.php

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM