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

后端 未结 14 1911
無奈伤痛
無奈伤痛 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:32

    I don't know why you would need this but to do this, you could edit your css file:-

    
    

    You have just added here and saved it as main.php. You can continue with main.css but it is better as .php since it does not remain a css file after you do that edit


    Then edit your HTML file like this. NOTE: Make the include statement inside the tag

    
    
     Sample
     
    
    
    ...
    ...
    
    
    

提交回复
热议问题