How to include PHP code in CSS?

前端 未结 4 1724
清酒与你
清酒与你 2020-12-09 06:47

I have a script, and I will be needing to include PHP code in the CSS stylesheet. But when I try adding PHP code in my CSS file nothing occurs! Is it possible?

4条回答
  •  死守一世寂寞
    2020-12-09 07:12

    Rename your CSS file to end in .php,

    styles.css -> styles.php
    

    However, I doubt that you really need to have PHP code in a CSS file.

    Good point from the comments below, place

    
    

    at the top of the file.

提交回复
热议问题