How to use relative paths for included files such as .css

后端 未结 8 1311
梦如初夏
梦如初夏 2020-12-29 15:07

I have a header.php file which contains a .css file link.

When I \"include\" header.php into another php file in different fo

8条回答
  •  余生分开走
    2020-12-29 15:29

    Simply define your base URL and concatenate it in CSS or JavaScript reference.

    Define it as below.

    define ('host_address','http://localhost:85/grc/');
    define('css', host_address.'styles/');
    

    I have defined base URL by host_address and CSS and used both of them as below.

    
    

提交回复
热议问题