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

后端 未结 8 1245
梦如初夏
梦如初夏 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:42

    Have a look at this answer to load css relative to the current js-file:
    https://stackoverflow.com/a/56580810/4865307

    With this trick, you just call c1CssImport() where you like to include relative-url based css files:

    c1CssImport('./ui.css');
    

提交回复
热议问题