How to import/include a CSS file using PHP code and not HTML code?

后端 未结 14 1810
無奈伤痛
無奈伤痛 2020-11-28 11:11

I have googled a lot but it seems that I am doing something wrong.

I want to do this:



        
相关标签:
14条回答
  • 2020-11-28 11:54

    If you want to import a CSS file like that, just give the file itself a .php extension and import it anyway. It will work just fine :)

    0 讨论(0)
  • 2020-11-28 11:55

    You are including the CSS code as text in your PHP page. Why not just link it in the traditional fashion?

    <link rel="stylesheet" href="CSS/main.css" type="text/css">
    
    0 讨论(0)
提交回复
热议问题